How do I summon a Zombie that doesn't attack me but attacks the other players?
I am working on a Minecraft map and I came across this. I am trying to make a special ability so that you can summon a Zombie that doesn't attack you but attacks the other players.
Best Answer
A mob will not try to attack you if you are on the same team as it. For example, you can create a team:
/scoreboard teams add FriendlyMobs
Then add yourself and the zombie to the team:
/scoreboard teams join FriendlyMobs @p @e[type=Zombie]
You could also summon the zombie already on the team:
/summon Zombie ~ ~ ~ {Team:"FriendlyMobs"}
Pictures about "How do I summon a Zombie that doesn't attack me but attacks the other players?"



Why is the zombie Villager not attacking me?
Make sure your not playing in peaceful mode, make sure you are in survival mode (/gamemode 0). Other mobs around him were attacking, so he couldn't be in creative.How do you get hostile mobs to fight each other?
1 Answer. Show activity on this post. If you use the command /effect |player name| resistance |period of time| 5 true you can make that person invincible. They mentioned that they needed mobs to be non-hostile, not simply that they didn't want to die.How to spawn only zombies in Minecraft! | Force kill with commands
More answers regarding how do I summon a Zombie that doesn't attack me but attacks the other players?
Answer 2
You could set up a contraption where it keeps the zombie away from you. Summon the zombie with a CustomName like this:
/summon Zombie ~ ~ ~ {CustomName:"NoAttackZombie"}
and then keep it away from you like this:
/execute {Your Name} ~ ~ ~ execute @e[type=Zombie,name=NoAttackZombie,r=2] ~ ~ ~ tp @e[type=Zombie,name=NoAttackZombie,r=1] ~1 ~ ~
So basically when the zombie gets close to you, it will constantly teleport 1 block away from you within a 2 block radius. However, all other players that are not running the execute command will not teleport the zombie away.
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
