TransWikia.com

How do you make villagers run away from the player?

Arqade Asked on January 1, 2021

When you punch a villager, it would run away from you until it reaches a distance and calm down so chasing it is actually possible.

I have my own solution for this where a baby zombie is constantly teleporting near you or above your head and iron golems and that zombie are on the same team so it wouldn’t bother to attack it.

I would like to know if there are other possible ways to make villagers run away from you relying entirely on commands. If possible, no visible zombies are allowed.

One Answer

The invisible zombie will attack you on survival, and if you're in creative the collision will move you. the thing you may first need it's the zombie (this time will be no invisible, but silent):

/summon minecraft:zombie ~ ~ ~ {Silent:1}

After, you will need add a team for

/team add zombie

After, you will need to modify the team and erase the teammate collision

/team modify zombie collisionRule pushOtherTeams

And then (optional), FriendlyFire

/team modify zombie FriendlyFire false

After, you will need add the zombie (and you). it's easy, you had to stay near to the zombie and put:

/team join zombie @e[type=zombie,distance=..3]

For you, only /team join zombie

Final step, you will need the zombie does not stay near of your camera (player vision) Put a repetitive command block, in it:

/execute at <your name> as @r run teleport @e[type=zombie,team=zombie] ^ ^ ^-1

Answered by Alex_Command on January 1, 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