I want to make a role-play world with my friends and one of them wants to be somewhat immune to zombies, but I have no idea how to do that.
2 Answers
Just give your friend a resistance so that he will not take damage:
/effect <nameOfYourFriend> resistance 999999 255 true
He will not receive any damage. This is a common method to give someone/something invulnerability in a custom map. If you have multiple friends that want it you can use the tag method which is also efficient.
-
This does not specifically answer the question. While it is a good workaround for some scenarios, it does not work in others. For example, what if this is in a PvP context? The zombies are supposed to ignore a single player, but that player still needs to be damaged by other players? Welcome to Arqade! Commented Dec 30, 2022 at 17:34
-
The only way to do this is to give the zombies weakness by using a command block on repeat, always active with the command /effect @e[type=zombie] weakness 99999 4 true
this command should make the zombies do no or almost no damage.