7

I've encountered a weird situation.
In Minecraft Education (which is based on Bedrock) I can spawn an NPC in two ways: spawn egg and via commands.

The result is pretty much the same, both spawn an NPC with default skin named "NPC", but something different happens when renaming them.

Suppose I want to create Alice via spawn egg, I simply spawn the egg and rename her through the dialog window.
Then I'll create Bob via the command /summon npc Bob ~ ~ ~

Both will result in an NPC with its name displayed in yellow, but are they actually the same?
The answer is NO.

Because if I try to select them via commands:

/execute as @e[name=Alice] run say @s
/execute as @e[name=Bob] run say @s

only Bob (the one created via commands) responds, Alice (the one which name is set through the dialog) is still named "NPC" and can't be matched.

Hence my question: which parameter is actually modified when I set the NPC name using the standard dialog?

1 Answer 1

3

When you change the name through the Window it only changes the Display Name but the Name it responds to stays as NPC. But when spawning through commands it changes both of them which is why only Bob responds to that command. I can't find a way to change the Name it responds to though.

2
  • 1
    The Minecraft Wiki suggests it's possible to change the real name (not display name) by renaming the spawn egg, although I haven't tried this yet to confirm it. Source: "[T]here is a difference between the display name (the one you can change in the interface and is shown to everyone) and the actual name. The actual name is the one you want to use when using "@e[name=NPC]", and is often by default, just NPC. If you want it to have a different name, use /summon or rename the spawn egg to the preferred name." from minecraft.wiki/w/NPC Commented May 20 at 17:51
  • @PianoCat98 yeah that's essentially what I wrote in my answer, I don't think it's possibile without commands
    – pinckerman
    Commented May 20 at 19:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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