I'm making a mc map and I want a zombiefied piglin walking over some blocks. I found out how to make him move, but I need a tagname for him, so it would only affect him and not the other piglins. How can I summon a entity with a NBT? I have searched almost every site and just can't find it. I tried CustomName but then the entity was not regonised. (Sorry for bad Englisch, I'm from Netherlands). Hope someone could help me...

New contributor
Didier Vermunt is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • Is there anything that you've already tried? Can you show us what commands you're using? You'll find that others will be more receptive of your question if you've shown some effort in solving it yourself. Please edit your question with the extra details. – MBraedley Jul 31 at 14:16
  • You could just name the piglin with a nametag, I think. – 12 rhombi in grid w no corners Jul 31 at 16:00

The Minecraft Wiki is definitely the first place you should look for command help. If you haven't heard of it, trust me, it is a lifesaver in commands.

The command you'll want to use is the /tag commmand. This lets you tag your mob with a recognizable text string and reference it again afterwards using the same string. Like this:

/tag @e[name="THE_PIGLIN",type=piglin] add movingPiglin

To reference the tagged entity at the end, you can learn how target selectors work, specifically the tag = argument.

| improve this answer | |

Your Answer

Didier Vermunt is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.