How can I teleport an entity to a random entity?
//ads -- adsterra.com -- native banner
?>
I made a command that, by all Minecraft logic, should work. My command:
/tp @e[name=NameA] @r[name=NameB]
I need it to teleport NameA to a random entity, which is named NameB. Instead, it says:
The entity UUID provided is in an invalid format
How do I make it do what I want it to do?
Best Answer
The error typically occurs when no targets were found, meaning either no entity existed with a name "NameA", or no player existed with a name "NameB".
If your @r selector is intended to target non-player entities, you'll need to specify the type parameter as otherwise it will only target players:
/tp @e[name=NameA] @r[type=!Player,name=NameB]
Pictures about "How can I teleport an entity to a random entity?"



How do you teleport a certain entity?
Players who want to move mobs to their character's position or move their character to the mob's position can use the following commands:Minecraft Command Blocks: Randomized Teleportation of Entities around an Entity or Location
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Anna Shvets, Tima Miroshnichenko, Alexander Sergienko, Alexander Sergienko
