Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-56653

When marked as killed by any entity, Zombie Pigmen drop XP and rare drops

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: 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
    • Fix Version/s: None
    • Labels:
      None
    • Confirmation Status:
      Confirmed

      Description

      As I understand it, hostile mobs aren't supposed to drop experience or rare drops and the like unless they were hit by a player or a tamed wolf within 5 seconds before death. However, in the latest snapshot, this is not true for Zombie Pigmen angered by an attack on another Zombie Pigman.

      To reproduce:

      Construct some iron golems. Spawn multiple zombie pigmen. Wait for the golems to kill the pigmen. 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 zombie pigmen in the line of fire. Experience orbs will be dropped, and maybe also rare drops if you're lucky.

      Analysis:

      From a decompilation of 14w21b's class "abd" method bz() (which appears to be the "for each tick" AI handler for zombie pigmen), there is code that appears to be checking for whether the pigman 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 zombie pigman 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 [Helper] Marcono1234 can be found in this comment.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                anomie x [Helper] Anomie X
              • Votes:
                22 Vote for this issue
                Watchers:
                22 Start watching this issue

                Dates

                • Created:
                  Updated:
                  CHK: