Minecraft – How to cure Zombie Pigmen anger infection

minecraft-java-edition

I noticed that if a Zombie Pigman screams after being hit, others join him and attack the player that hurt their "friend". After both playing and doing a research on the wiki, I realised that this anger will "infect" other Zombie Pigmen far, far away, even at 500 blocks away, because the anger passes from one to another. This is annoying, especially when you think that you escaped, then everyone suddenly attacks you. (Of course, this happens because they even spawn in hidden caves, passing the anger through the wall.)
How do I prevent future anger infection effectively, without having to wait too much?

Best Answer

If you don't want to wait, you need to make the pigmen despawn - for example by moving over 128 blocks in one direction and coming back. This will make all angry pigmen in the area despawn and while you are coming back new pigmen will spawn that would be passive. Be careful though - if during the trip an angry pigman takes damage, it will start a new 'infection' cycle.

Quiting the game doesn't make pigmen passive - this was fixed a while ago - their 'anger' state is now saved in the entity NBT data (and I just confirmed it in-game on 1.8.9).

Dying also does not make pigmen passive - I just confirmed it in-game on 1.8.9.