Ok, I want my character to either be ignored by zombies or unable to die (invincible). I've tried:

  • Adding a health scoreboard but this is uneditable

  • A repeating command block that gives the player instant health

    effect give @a[scores={ifBeast=1..}] minecraft:instant_health 1 10
  • Making the player invisible (If you get close to the zombies they chase you)

None of the above work. The option that I would prefer is for the Zombies to completely ignore the player, but if I must resort to them being invincible to zombies while still getting hit (irritating) then I will accept that.

  • I might just have got this. I'm considering adding a "team" element.
    – Reflexive
    Feb 23, 2017 at 18:30

1 Answer 1


Create a team:

1.13+: /team add friendly
1.12-: /scoreboard teams add friendly

Join the team:

1.13+: /team join friendly
1.12-: /scoreboard teams join friendly

On a clock, make all zombies join the team:

1.13+: /team join friendly @e[type=zombie]
1.10-: /scoreboard teams join friendly @e[type=Zombie]

Mobs in the same team as you will not attack you.

  • Yep works perfectly thanks. (Will accept in 8 minutes)
    – Reflexive
    Feb 23, 2017 at 18:35
  • Did you forget to set friendlyFire to true, or do you not need to?
    – One 2 Many
    Dec 13, 2020 at 16:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .