The floating name on the top of the npc's head is not the real name, the real name is the name used when summoning with "/summon", or the name of the item "spawn_egg" named with the anvil
The floating name on the top of the npc's head is not the real name, the real name is the name used when summoning with "/summon", or the name of the item "spawn_egg" named with the anvil