-
Bug
-
Resolution: Unresolved
-
Minecraft 14w21a, Minecraft 14w21b, Minecraft 14w25a, Minecraft 14w25b, Minecraft 14w27b, Minecraft 14w28a, Minecraft 14w29b, Minecraft 14w32a, Minecraft 14w32b, Minecraft 14w32c, Minecraft 14w32d, Minecraft 14w34b, Minecraft 1.8-pre1, Minecraft 1.8-pre2, Minecraft 1.8-pre3, Minecraft 1.8, Minecraft 1.8.1-pre2, Minecraft 1.8.1, Minecraft 1.8.2-pre1, Minecraft 1.8.2-pre2, Minecraft 1.8.2-pre3, Minecraft 1.8.2-pre4, Minecraft 1.8.2-pre5, Minecraft 1.8.2-pre6, Minecraft 1.8.2-pre7, Minecraft 1.8.2, Minecraft 1.8.3, Minecraft 1.8.4, Minecraft 15w32b, Minecraft 15w44b, Minecraft 15w45a, Minecraft 15w47a, Minecraft 15w49a, Minecraft 15w49b, Minecraft 15w50a, Minecraft 15w51b, Minecraft 16w02a, Minecraft 16w03a, Minecraft 16w04a, Minecraft 16w05a, Minecraft 16w05b, Minecraft 1.9 Pre-Release 1, Minecraft 1.9 Pre-Release 2, Minecraft 1.9 Pre-Release 3, Minecraft 1.9 Pre-Release 4, Minecraft 1.9, Minecraft 1.9.1 Pre-Release 1, Minecraft 1.9.1 Pre-Release 2, Minecraft 1.9.1 Pre-Release 3, Minecraft 1.9.1, Minecraft 1.9.2, Minecraft 16w14a, Minecraft 1.9.4, Minecraft 16w20a, Minecraft 1.10.2, Minecraft 1.11, Minecraft 1.11.2, Minecraft 17w06a, Minecraft 1.12.2, Minecraft 18w16a, Minecraft 1.13-pre7, Minecraft 1.13-pre10, Minecraft 1.13, Minecraft 18w31a, Minecraft 1.13.1-pre1, Minecraft 1.13.1-pre2, Minecraft 1.13.1, Minecraft 1.13.2-pre1, Minecraft 1.13.2, Minecraft 19w04b, Minecraft 1.14 Pre-Release 5, Minecraft 1.14.2, Minecraft 1.14.3 Pre-Release 1, 1.14.4, 1.15.2, 20w09a, 20w13b, 20w16a, 20w21a, 20w22a, 1.16 Pre-release 3, 1.16.1, 1.16.2, 1.16.4 Pre-release 2, 1.16.4, 20w49a, 20w51a, 21w05b, 1.17 Release Candidate 1, 1.17 Release Candidate 2, 1.17, 1.17.1 Pre-release 3, 1.17.1, 1.18 Pre-release 1, 1.19 Pre-release 5, 1.19, 1.19.2, 1.19.3, 23w03a, 1.20.1, 23w33a, 1.20.4, 24w09a, 1.21
-
Confirmed
-
Mob behaviour
-
Normal
-
Gameplay
The bug
If a piglin is in a hostile state due to another piglin being attacked by the player or any other mob, it will drop XP and rare drops upon death by any source (including mob damage, suffocation and /kill).
To reproduce
- Construct some iron golems. Spawn multiple zombified piglins. Wait for the golems to kill the piglins. Experience orbs will be dropped, and maybe also rare drops if you're lucky.
- Trap a skeleton where he can shoot at you but not escape. Spawn multiple zombified piglins in the line of fire. Experience orbs will be dropped, and maybe also rare drops if you're lucky.
- Summon multiple piglins and a single Johnny vindicator. Killing the piglins with /kill @e[type=piglin,distance=..10] or suffocating them before their anger timer runs out (after 20-40 seconds) should cause them to drop XP, despite never having interacted with the player.
Analysis
From a decompilation of 14w21b's class "abd" method bz() (which appears to be the "for each tick" AI handler for zombified piglins), there is code that appears to be checking for whether the piglin is angry and has the UUID of who he's angry at but no actual target, and if so it attempts to find the player corresponding to the UUID. And for some reason it also sets what appears to be the "damaged by player" counter (field "aM"), even if the UUID doesn't actually correspond to a player. And further, it appears to be setting the counter to the wrong value.
It appears that it'll also set the "damaged by player" counter incorrectly when loading the zombified piglin from NBT, although in this case I'd guess it'll probably be setting it to 0 so it shouldn't matter much.
Code analysis by marcono1234 can be found in this comment.
- blocks
-
MC-187449 Zombie Pigmen/Zombified Piglins do not drop XP and rare drops anymore if killed by anything other than the player while in angered state
- Resolved
- is duplicated by
-
MC-60347 PigZombie Golem Experience
- Resolved
-
MC-66672 Mobs that die of natural causes drop exp
- Resolved
-
MC-68106 Zombie Pigman/Pigmen drop xp and loot as if you attacked them
- Resolved
-
MC-94350 /kill causes angry pigmen to drop XP and rare drops
- Resolved
-
MC-153953 Aggroed pigmen drop experience and gear when killed with command blocks
- Resolved
-
MC-163900 Zombie pigmen do not drop gold ingots if aggro'd by a snowman, yet they still drop their swords.
- Resolved
-
MC-169824 Aggressive zombie pigmen giving xp from death
- Resolved
-
MC-173979 Zombified Piglins sometimes drop experience orbs when killed by non-player mobs.
- Resolved
-
MC-177234 Zombie Pigman does not drop gold ingot in some cases.
- Resolved
-
MC-188469 Zombified piglins drop Xp and item drops if killed by anything other than the player while being in angered state
- Resolved
-
MC-188492 Zombie Pigmen/Zombified Piglins drop XP and rare drops if killed by anything while in angered state
- Resolved
-
MC-192566 Zombie Piglins killed by named Vindicator (Johnny) drops XP
- Resolved
-
MC-264094 Zombified Piglins drop XP when killed by Warden
- Resolved
-
MC-269058 Zombified piglins drop experience when killed while in angry
- Resolved
- relates to
-
MC-69032 When a mob hits a zombified piglin, and that mob dies, the zombified piglins attack you
- Resolved
-
MC-188509 Zombified Piglins drop experience but not gold ingots when they die while aggressive
- Resolved
-
MC-150195 Mobs never drop their gear unless killed by the player
- Resolved
-
MC-187504 Mobs do not drop rare drop items when killed by a player in Creative Mode
- Resolved