Minecraft – How to have a name floating over a button

minecraft-java-edition

In lots of Minecraft minigames I have seen buttons, for example to start the game, that have a floating name tag above them. How do they do that ?

Best Answer

You can use a named invisible WitherSkull.

summon WitherSkull ~ ~ ~ {
    CustomName:"Whatever",
    CustomNameVisible:true,
    Direction:[]
}

(This is from memory, but I think that's it)