Is it possible to make a zombie which prefers killing either the nearest villager or player? I have been doing some tests and I noticed that Zombies alway kill first the player and then the villager, even if the player is further away.
The Meaning of Life, the Universe, and Everything.
Join Date:
9/2/2014
Posts:
54
Member Details
Yes, you see a Zombie by default will attack the player and vilagers. You can change disable that for one of those classes so, it wont attack the villagers OR the players (Or both).
Make 1 scoreboard team called anything you like, i named it "Ally":
/scoreboard teams add Ally
Then you need to choose to protect the players or the villagers.
FOR THE PLAYER:
Firstly select the player you want to protect, i used the closest player/@p: /scoreboard teams join Ally @p
Then make the zombie to join the same team, doing so will force the zombie to NOT attack, i used a zombie that is named Friend. /scoreboard teams join Ally @e[type=Zombie,name=Friend]
Have in mind though that this WONT work for all the zombies but for the closest zombie named Friend, and it will not attack at the closest player.
There is a way to make it for ALL THE ZOMBIES not to attack a SPECIFIC player. Just add the following command on a clock: /execute @p ~ ~ ~ scoreboard teams join Ally @e[type=Zombie,r=30]
This will automaticly add in the Ally team any zombie in range of 30 blocks.
And done
FOR THE VILLAGER:
Read the "FOR THE PLAYER" for more info:
Choose a villager to protect(i used the villager that was in range of 5 blocks away) /scoreboard teams join Ally @e[type=Villager,r=5]
Then choose the zombie that you want to be neutralized, I used one zombie named "Friend" /scoreboard teams join Ally @e[type=Zombie,name=Friend]
And like so, you are done! Now that will work ONLY with a villager and a zombie BUT you can add on a clock this command to make it work for EVERY zombie. Note: Its possible to name all the villagers the same so it will affect all of them, but i am not sure.
I named my villager: "Human" and my zombie: "Friend" /execute @e[type=Villager,name=Human] ~ ~ ~ scoreboard teams join Ally @e[type=Zombie,name=Friend,r=30]
And like so every zombie that walks in range of 30 blocks by this villager will be neutralized.
Done I hope i helped, let me know if you need anything else.
Make 1 scoreboard team called anything you like, i named it "Ally":
/scoreboard teams add Ally
Then you need to choose to protect the players or the villagers.
FOR THE PLAYER:
Firstly select the player you want to protect, i used the closest player/@p:
/scoreboard teams join Ally @p
Then make the zombie to join the same team, doing so will force the zombie to NOT attack, i used a zombie that is named Friend.
/scoreboard teams join Ally @e[type=Zombie,name=Friend]
Have in mind though that this WONT work for all the zombies but for the closest zombie named Friend, and it will not attack at the closest player.
There is a way to make it for ALL THE ZOMBIES not to attack a SPECIFIC player. Just add the following command on a clock:
/execute @p ~ ~ ~ scoreboard teams join Ally @e[type=Zombie,r=30]
This will automaticly add in the Ally team any zombie in range of 30 blocks.
And done
Read the "FOR THE PLAYER" for more info:
Choose a villager to protect(i used the villager that was in range of 5 blocks away)
/scoreboard teams join Ally @e[type=Villager,r=5]
Then choose the zombie that you want to be neutralized, I used one zombie named "Friend"
/scoreboard teams join Ally @e[type=Zombie,name=Friend]
And like so, you are done! Now that will work ONLY with a villager and a zombie BUT you can add on a clock this command to make it work for EVERY zombie. Note: Its possible to name all the villagers the same so it will affect all of them, but i am not sure.
I named my villager: "Human" and my zombie: "Friend"
/execute @e[type=Villager,name=Human] ~ ~ ~ scoreboard teams join Ally @e[type=Zombie,name=Friend,r=30]
And like so every zombie that walks in range of 30 blocks by this villager will be neutralized.
what happens if you want to do this with summoned zombies from command blocks