TransWikia.com

How to teleport nearby villagers to me?

Arqade Asked by stackers on August 4, 2021

I want to move all my villagers back to the middle of my town. I’m trying to work with the /tp command, but almost every time it says Entity not found.

/tp @e[type=minecraft:villager,dx=300,dy=300,dz=300] @p

/tp @e[type=minecraft:villager,distance=200] @p

The only time it worked was when I did this:

/tp @e[type=minecraft:sheep] @p

and it teleported like a hundred sheep into me.

Is there a reason the above ones wouldn’t work?

1.14.4, using LAN mode with one other person

One Answer

The first command doesn't always work because it's selecting a box that extends 300 blocks in the x, y, and z directions from your current location. If there's no villager in that box, they're not going to be teleported. You shouldn't be using the dx, dy, and dz selector arguments without the z, y, and z selectors in most cases anyway. This kind of selection is best reserved for finding a target within a very specific box, which is probably not the case here.

The second command doesn't work (except in very specific contrived circumstances) because you are trying to find a villager exactly 200 blocks away. For various reasons, this is basically impossible in normal gameplay. Fortunately it's relatively easy to fix this by searching for a villager less than or equal to 200 blocks away:

/tp @e[type=minecraft:villager,distance=..200] @p

If you only want to teleport a single villager instead of multiple villagers, it's simple to impose that limit as well:

/tp @e[type=minecraft:villager,distance=..200,limit=1,sort=nearest] @p

or to get a random villager:

/tp @e[type=minecraft:villager,distance=..200,limit=1,sort=random] @p

Correct answer by MBraedley on August 4, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP