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...
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.