The bug
Zombie pigmen can become aggressive to the player if hit by another mob (i.e. skeletons and blazes), and newly spawned pigmen (even hundreds of blocks from the incident) will spawn aggressive without provocation. They attack only the player if they're hit by a different agro'd hostile mob.
Replicate: (In creative) Spawn a lot of pigmen (with dispenser and redstone clock), and a skeleton. (Switch to survival) the skeleton will shoot at the player, but hit a pigmen instead. Kill the skeleton, and then all of the pigmen will attack the you, regardless of whether you hit them.
TL;DR: Any hostile mob hits zombie pigmen. You kill the hostile mob. Pigmen attack you.
Code analysis
This behavior might be intended, see this and this comment.
Linked issues
is duplicated by 60
relates to 2
Attachments
Comments 129
https://www.youtube.com/watch?v=vokGKpkYV_Q
Able to reproduce.
I can definitely confirm that this is an issue. I have video evidence below:
Same issue in 1.8. blaze attacked me and hit pigmen, all pigment became agro. went over 500 blocks away and pigmen remained agro in all areas.
edited: spelling
so if you don't kill the mob, you're safe? (aside from getting shot at of course)
Yup, pretty much.
Also this is related to MC-47824 (part of it describes Zombie Pigmen not attacking other mobs).
Still in 1.8.1 https://www.youtube.com/watch?v=0X5d1dinuEU&channel=svrdeathmatch (in case there was any doubt that it was fixed)
Using Blazes, I can also reproduce this by simply crushing the blaze, rather than killing it by hand. It seems like the pigmen remember getting attacked by something, and thus they are angry. Their target is the mob that attacked them, but they refuse to attack other hostile (like Skeles, Blazes), so they simply stand there angry. As soon as the mob that angered them dies, they redirect their anger to the nearest player.
Interestingly, it seems like having the offending blaze killed by another blaze doesn't seem to do it. Or maybe I was doing it wrong.
I also got bitten by this bug and have aggro pigman all over the place. In my testworld this did help /kill @e[type=PigZombie] ergo kill all pigman, they will soon respwan but not aggro.
It's happened to us multiple times. The pigmen hunt down and kill every single member of your party and basically make nether fortresses unplayable.
I'm also having pigmen become aggro'd every few minutes without any visible provocation here. I'm not sure if they're being hit by a mob somewhere or what, but I can't see any cause.
Confirmed for 1.8.6, per MC-80926.
Confirmed for 1.8.7
The mob doesn't even have to die from the player! I set an iron golem on the skeleton that had shot the pigmen and they were aggroed on me still!
Edit: Lava is broken too. I think any damage source will do, even if not player inflicted. If so this is more annoying than I thought.
No. I meant any damage source to kill the living entity that damaged the pigman.
Edit: such as a skeleton
1. Get skeleton to shoot pigman.
2. Bucket of lava at skeleton's feet
3. Move away and log out
4. Everyone on your server gets eaten by pigmen
This has been the cause of MUCH grief on my server and needs to be fixed. Unfortunately, I doubt it ever will since Jeb_ deliberately put this functionality in the game.
Minecraft 1.8.6 is also outdated, but it's still listed above in the "affects versions."
In 15w36d it is now even worse: pigmen aggro at all players immediately when they are hit by a blaze fireball. (Have not tried with other mobs.)
I have something to add about this bug. I designed a difficult survival nether-based map and many players complained about the severity of this bug on hard difficulty. Also you no longer have to kill the mob for them to target you. They now appear to target the player immediately when hit by any projectile.
I ran some tests and found the following:
Pigmen immediately aggro on a player if their Anger tag becomes nonzero. This is why if any mob hits them other then the player they target the player immediately. It appears to be the closest player at the time. If you wish to quickly replicate the bug just type this command with pigmen close by: /entitydata @e[type=PigZombie] {Anger:500}
The reason this happens is the HurtBy:"" tag no longer appears to work. The pigmen do not understand the new 1.8 UUID system for entities and I've only seen the player UUID in this spot, never that of the mob that launched the projectile.
On hard difficulty this is especially annoying due to pigman density. Pigmen never seem to be able to become unangry in 1.8. I ran some tests and found that this is because when the anger on one pigman falls to zero it is seen as a recruitable pigman again and the hostile pigman make it angry again. the result is if more then a few pigmen are angry at you it no longer wears off like it used to in 1.7 they are literally angry forever.
You also can't really run away, especially on hard, because you can't get far enough away before the anger is passed to newly spawning pigmen.
The ONLY way I found to reliably fix it on hard mode survival is to force a despawn with distance. aka have a bridge out over a large lava lake where you can get far enough from all of them to force despawn before anger is passed to new pigman groups or to get above the bedrock into the void. However, this is way too much trouble to be a practical way to end this nightmare. Killing them also will not work as they have a recruit and follow distance greater than the 24 blocks and so in many situations will never stop spawning new angry pigmen. this is especially true as the angry pigmen below you in closed caverns will not come and will continue to anger new groups.
I have a quick fix suggestion for this bug that I'm begging you to implement as this bug is extremely annoying for any player spending a small amount of time in the nether: Please, code it so that the pigmen's anger tag does not become nonzero if they are hurt by a projectile not fired by the player. My tests show as long as the anger tag does not change the pigmen will no longer aggro at the player when struck by projectiles of other mobs. this should be fairly easy to do as skeleton arrows, blaze fireballs, and ghast shots are coded differently then player-fired projectiles. This is my suggestion to fix the issue in the meantime until you can fix the targeting bug and make them fight other nether mobs again. For my map I provide a custom item to deal with the pigmen when the bug occurs. ( A book with imbedded command) but I'd prefer to see it fixed in the main game. This bug is discouraging players from spending a lot of time in the nether at present.
Dan Midgett, please use the 'preview'-feature when trying to get the formatting right. Every single little committed/saved change generates a new email for those who are watching the issue.
@Dan Midgett would you be willing to share the method of creating that command book, my server admin would also like to use it, thank you. I know perhaps this is not the place for a request like this but there is no way to contact you other then this way, again thank you for the details you have provided
Just to keep up the momentum, rather than report a separate bug, this is still ongoing in 1.8.8 which I think we already know. As previously stated, it affects playability in the Nether because there's now much more luck involved in Nether survival than actual skill.
I did some testing in survival, and without being near any pigmen, if a Ghast fireball aimed at me hit a pigman, all the nearby pigmen immediately became aggressive towards me.
It's my case I play Minecraft with my young daughters who are quite wary of entering the Nether anyway, for good reason. I've been saying "don't attack the pigmen", which we all know, but as the pigmen get angry anyway no matter how careful they are, it spoils their enjoyment of the game.
So - is this actually a bug, or is this now considered intended behaviour? If it is, then please can we see it fixed in 1.9? If not, then could the wiki be updated to reflect this, and the issue closed? What I don't think is helpful for anyone is just leaving the bug open.
I would sat that it was never originally intended as AFAIK the bug is due to not reading an NBT tag (this issue also causes a different bug with pigment as well that definitely isn't intended).
The nature of this bug has changed in the latest snapshot. I just ran tests after seeing that it was a major mob AI update.
the results:
When hit by skeleton arrows pigmen now properly target and kill the skeleton in question. But afterward they still went after me and killed me too since they were still angry. Seems they still default to aggroing on the player if the anger tag is still nonzero but only after the primary target has been eliminated. Is this intended?
Ghasts/Blazes they did not seem to get angry at all which is nice. Hit multiple times with fireballs and no reaction. they used to target the player after getting struck. But, strangely enough shortly after getting hit by the projectiles from them the game crashed. This happened repeatably many times. It think it is because the pigman is targeting the projectile instead of the ghast/blaze and the game crashes when the projectile disappears. In the error log the crash happened because of a null pointer in a fireball. I'm not sure what that means. Let me know if you want more details.
Well, a null pointer is when a value that doesn't exist tries to be accessed by the programming so your idea is probably correct. Is there a ticket for the crash?
yes I opened a seperate ticket and uploaded the crash report. This is still the first snapshot of the new AI changes so I won't discuss it much here but here's the link if you're curious: MC-93655
Also if the pigmen kill them.
This, on the other hand is a bug in deep need of fixing.
I wish you could give them gold or something to make them friendly again.
Affect 1.9pre1 2 3 and 4, they need to fix this issue, a blaze fired at a pigmen near my blaze farm and I was dead in no time, lucky for me I always place important stuff in my ender chest
There are many ways for pigmen to become hostile to the player, almost all of them involving an entity not affiliated with the player hurting the pigmen. Sometimes they become hostile when you kill the mob that hit them, sometimes they become hostile immediately, and sometimes they ignore the hit. It is rather unpredictable.
I have just confirmed that it is basically impossible to get pigmen angry at you before 1.8 without actually attacking them.
I hope it says "Fixed" soon. I'm scared to even do wither skeleton farming because I have 139 levels and that is my only danger.
@Sam_Bone I don't think it's possible for wither skeletons to accidentally hit a pigman, so you're safe there.
The wither skeletons can't really hit a pigmen, but you can accidentally hit a pigmen while hitting a wither skeleton, or a damn regular skeleton can hit the pigmen. Its a nightmare right now, I avoid the Nether like the plague, and I don't think they consider this a bug so I would be surprised if the fix this issue. Its getting worse with the new combat update, a swing of your sword can hit a pigmen while you wanted to just kill a blaze and bam, you're dead.
Any forums to discuss that horrible issue and vent a little, just got killed again by a horde of zombie pigmens that got shot by a ghast, smart me killed the ghast and then, I've lost a full set of diamond armors with mending on each pieces 3 stacks of nether quartz half a stack of glowstone blocks, a silk touch pick with mending on it, around 45 steak and 6 fire resistance potion. All of this because of a stupid bug that should have been fixed before but nope.
@McDodge34 you are exaggrating a lot, calm down. In my 5 years of Minecraft, the situation you described as unplayable happened to me just twice . Also it is hard for them to be aggresive to ghast since when they can't find the path to walk, aggro fades away so it is a rare condition.
@Mert Serimer 1- the bug started with 1.8 so "5 years" is irrelevant. 2- I've had this happen to me multiple times in the same hour. It can happen quite regularly if you are in or near a nether fortress. Maybe you don't play in the nether but some of us do.
I can confirm that the Nether did suddenly become far more difficult in 1.8 due to the zombie pigmen aggression bug(s), but this is not the forum to discuss your emotional relationship with said issues.
In 1.9.2 it is partially fixed but now actually much worse: the pigmen now do pursue and kill the mob that hit them, which is how it should be. But as soon as they've killed it, they turn their aggro toward the player. This means they will attack the player even more often than they did before.
The code suggests this is actually intended.
The code basically reads like this:
if you hurt pigmen then anger other pigmen.
if pigmen is angry and has no target then target nearest human.
Most players are only aware of the first behaviour; but the second behaviour has been specifically coded to be the case. By killing the target of an angry pigmen, you make yourself the target.
In every case, the code reads such that the bug should occur. It may vary depending on software if the code includes lines that not all programmers interpret the same way, but overall, one way or another, the code says to do it. It's a bug if the human authors of said code did not intend for the end result.
This one has been "confirmed", but that may just mean that the behavior is recognized to definitely occur. Perhaps the dev team does not feel that the listed behavior is a bug, or that it is a bug but they are not prepared to revert that segment of the code because it has other purposes for being written that way. It is also possible that whoever wrote the segment of code did not fully realize the impact it would have on the game, and that other devs who reviewed the code did not realize either.
It could help us bug reporters if the devs would tell us what behavior they did intend for the zombie pigmen to have, but that's not likely to happen.
md_5 said... "By killing the target of an angry pigmen, you make yourself the target."
Which does not really make sense. A gast hits a pigman, pigman gets angry at gast. you kill the gast, so pigmen get angry at you (or someone else that is closer). Really you helped the pigmen by killing the thing that hurt it. Why should it get angry at you!
At least they stopped pigmen continuously making more pigmen angry, unless you hit them again. That bug was the real nasty one of previous releases!
I don't think "if pigmen is angry and has no target then target nearest human" means this behavior is intended.
Before 1.8, pigmen would become angry only if a player hit them. If another mob hit them, only the pigman that was hurt would react. 1.8 made pigmen angered by mob attacks, resulting in them ganging up on mobs as they would on players. However, this anger state is the same state used when a player angers a pigman, so it made pigmen act angry to the player when they aren't otherwise targeting a mob. The only thing that distinguishes if a pigman is angry at players or a mob is their current target. So if their current target dies, no matter what kills it, pigmen default to attacking players.
This means the code mentioned assumes only players can anger pigmen, as it used to be in 1.7 and earlier.
Still an issue in 1.11. The title/description should be changed to reflect that the player does not need to kill the mob to aggravate the pigmen, the mob only has to die in some way.
The code basically reads like this:
if you hurt pigmen then anger other pigmen.
if pigmen is angry and has no target then target nearest human.
The code (as of 1.11.2) seems to mean more than that:
If a living entity (including player) attacks a zombie pigmen (via AIHurtByAggressor):
Trigger aggro towards the attacker on the attacked pigmen and nearby pigmen
Trigger anger towards the attacker on nearby pigmen, excluding the attacked pigmen
If a player attacks a zombie pigmen (via attackEntityFrom):
Trigger anger towards the attacker on the attacked pigmen
If a zombie pigmen is angry (positive anger timer):
Receives an attacking speed boost unless it is a baby pigmen (via updateAITasks)
Decrease anger timer (via updateAITasks)
Trigger aggro towards the player (but not other entities) it has anger towards (via updateAITasks) - I think this is to ensure a resumed chasing when the player reenter the pigmen's search range
Trigger aggro towards nearest player (via AITargetAggressor) - the direct cause of this issue
I'm not sure if all of the above are intended; there may be some unnecessary inconsistencies / redundancies.
In any case, as others have already mentioned, nether raiding in hard difficulty is unnecessarily difficult with this bug, especially in nether fortresses where it is difficult to avoid blazes and skeletons hitting zombie pigmen.
I tried extensively to replicate this bug in 1.11 and failed. Many times I saw zombie pigmen attacked by other mobs but not once did they ever aggro to the player. I haven't seen this bug since 1.8.
Also of note, the group of pigmen will target and kill the attacking mob first, then proceed to attack the player. After this point, only pigmen that are damaged by another mob will target that mob. The group will continue to target the player.
Attached is the datapack I have used to reproduce this issue. It contains a function that, when run, summons several pigmen riding a pufferfish and sets the executor's gamemode to survival mode (although this issue can also be reproduced in adventure mode). The pufferfish withers away (it was summoned with the wither effect) and the pigmen begin attacking the player.
Got this bug recently in 1.13.2.
While in the Nether, two Skeletons were aiming at me, one missed and hit the other Skeleton, so I left them to fight each other and watched them from a little further away.
While fighting each other, one Skeleton hit a nearby Pigman. The Pigmen killed the Skeleton that hit them, then they all targeted the second one. Thus far, I didn't notice any change in behavior from the Pigmen near me. When the Pigmen killed the second Skeleton though, then all the Pigmen near me became aggressive towards me.
So, apparently, they aren't automatically agressive towards the player once they kill the mob that hit them, they just turn aggressive towards the nearest mob?
Hope it helps. 😃
Confirmed for 1.14.2.
What I noticed about the behavior was that the zombie pigman that aggro'd toward the skeleton did NOT aggro toward me, but rather any other surrounding pigmen did. The initial pigmen struck would not engage until I as a player struck another pigman.
This recently started for me, latest update. It had never happened before. It seems the Pigmen will aggro even if taking fall damage. The hostility also will not time out. It seems the pigmen are continuing to take fall damage as they get pushed around in a Pigman mosh pit.
1.14.1
PC
Windows 10 Home build 1803
(Played MC on this machine for two years, first happened Saturday 5/25/19)
Skeleton hit pigman, they killed him and now they wanted to kill me.
Version 1.14.2
I can't possibly believe this is intentional. Whoever marked it as such either doesn't understand what the bug is, or doesn't understand what makes a game fun (or unfun.)
This bug is more dangerous in the 20w07a snapshot with the introduction of Piglins.
Piglins go hunting for a hoglin using crossbows.
Piglin misses hoglin and hits zombie pigman.
All zombie pigmen aggress and attack piglin.
Piglin dies.
All zombie pigmen aggress against player.
The Piglins can cause aggression against the player without the player being involved.
I suppose this is a feature as pigmen will take their anger on players if no targer exists anymore.
@unknown That seems rather uncertain, considering Mr. Hedberg reopened this bugpost 4 months ago, only 1 day after it had been resolved as "WaI".
It seems, right now all we can do is to wait it being either fixed or resolved again as WaI, after careful consideration about how this may affect Survival gameplay, even more so after the Nether update.
Not sure if it was mentioned but the Zombified Piglin that got hit by the other mob doesnt get angry at you while others do
Hardcore player biting the dust: https://clips.twitch.tv/GoldenGleamingChipmunkWholeWheat
Confirmed for 20w20b. The zombified piglin that got attacked by the mob does not attack, but the other zombified piglins attack. So to test this bug you nees at least two zombified piglins.
Can confirm now!
Blaze shot a Pigmen and all of them got agressive to me.
Relogged and Pigmen were friendly again.
Previous:
I think you meant "if hit by another Mob" right?
Cannot reproduce.
I think your pigmen were aggresive before a e.g. Skelton hit them.
Then they got aggresive to the Skelton and didn´t hunt you anymore.
If you kill the Skelton they will become aggresive to the players again.
(i´m not sure but thats the only thing I can think of and reproduce)