Can someone help me figure out how to use execute to summon a mob at a player with a name?
//ads -- adsterra.com -- native banner
?>
I've tried to use:
{CustomName:['<name>']}
but it doesn't work. What should I use instead? Plz help me.
Best Answer
CustomName
is a string rather than a list containing a string. Thus, the data should look like: {CustomName:"<NAME>"}
Your full command should look like:
/execute <PLAYER SELECTOR> ~ ~ ~ /summon <MOB TYPE> ~ ~ ~ {CustomName:"<NAME>"}
Pictures about "Can someone help me figure out how to use execute to summon a mob at a player with a name?"
How do you summon a mob with a nametag?
How to Enter the CommandHow do you spawn mobs around a player?
The command for summoning is pretty simple. "/summon mob". Players just need to fill in the mob name, though there are a few exceptions. The command remains the same for both Minecraft Java and Bedrock Edition, and is one of the simplest to use.How do you execute a player command in Minecraft?
Type the command in the chat window and press the Enter key to run the command. Once the cheat has been entered, the flame particle will appear directly 1 block in front of the entity running the command.How to detect mobs with custom names near a player?
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: SHVETS production, Pixabay, Andrea Piacquadio, Julia Larson