How do I use /tp to tp a player to a mob with a name

How do I use /tp to tp a player to a mob with a name - Focused ethnic female DJ playing music at nightclub

I would use/tp @p @e[type=ArmorStand] but if there are other Armor Stands in the world the person would tp to that Armour Stand.



Best Answer

Use the name argument in the selector:

/tp @p @e[type=Zombie,name=David]

You can summon in a named zombie like this:

/summon Zombie ~ ~ ~ {CustomName:"David"}

Or rename a zombie egg in an anvil then use it.




Pictures about "How do I use /tp to tp a player to a mob with a name"

How do I use /tp to tp a player to a mob with a name - Young male gamer wearing VR headset for exploring cyberspace and playing video games looking at camera
How do I use /tp to tp a player to a mob with a name - Serious man in headset for playing video game
How do I use /tp to tp a player to a mob with a name - Woman playing piano at free time





Minecraft - How to Teleport Players to Mobs




More answers regarding how do I use /tp to tp a player to a mob with a name

Answer 2

For multiple teleportations I would use the following command:

/summon Arrow ~ ~1 ~ {CustomName:"Tp Location",CustomNameVisible:1,inGround:1,pickup:2,life:-9999}

This summons a near infinitely lasting arrow that is called "Tp Location", you can change that to whatever you want, eg spawn, home, starship, endportal, what ever you feel is appropriate.

Then you simply do the command:

/tp @p @e[type=Arrow,name=Tp Location]

This teleports you to that arrow, and you can not be teleported to any other arrow as they can not be named without command.

Just don't name the arrows the same things, eg "home" and "home", as it won't work.

And don't tp to the arrows in creative as they get picked up, used as a fast removal method.

You can also make the player remove the arrow by doing:

/execute @p ~ ~ ~ /kill @e[type=Arrow,name=TP NAME]

This makes it possible to make one way tp points.

I have tested this in 1.9.4, and no other versions, if it doesn't work then it is because you are in a different version of Minecraft.

TL;DR: Use named arrows.

Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Fardad Postwala, Eren Li, Eren Li, Charles Parker