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

Player can interact with dying mobs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Minecraft 19w11a
    • Minecraft 1.8, Minecraft 1.8.1, Minecraft 1.8.2-pre1, Minecraft 1.8.2-pre4, Minecraft 1.8.3, Minecraft 15w49a, Minecraft 15w49b, Minecraft 1.8.9, Minecraft 15w50a, Minecraft 16w05a, Minecraft 16w06a, Minecraft 1.9.2, Minecraft 16w14a, Minecraft 16w15a, Minecraft 16w15b, Minecraft 1.9.3 Pre-Release 1, Minecraft 1.9.3 Pre-Release 2, Minecraft 1.9.3 Pre-Release 3, Minecraft 1.10.2, Minecraft 16w43a, Minecraft 16w44a, Minecraft 1.11, Minecraft 1.11.2, Minecraft 1.12, Minecraft 1.12.1, Minecraft 1.12.2 Pre-Release 1, Minecraft 1.12.2, Minecraft 17w49a, Minecraft 17w49b, Minecraft 18w10c, Minecraft 1.13-pre3, Minecraft 1.13-pre6, Minecraft 1.13-pre10, Minecraft 1.13, Minecraft 18w30b, Minecraft 18w31a, Minecraft 1.13.1
    • None
    • Confirmed

      The bug

      Player can interact with with mob while their dying animation is happening. This can partwise result in mobs in invalid states, entity "duplication" and other unwanted situations.

      Affected situations

      Situation Note
      shearing sheep -
      taming wolf results in alive tamed wolf with dying animation
      taming ocelot -
      feeding (baby) animal -
      shearing mushroom -
      using name tag -
      using leash leash is used but instantly dropped at position of mob
      using flint and steel on creeper creeper is not ignited but flint and steel loses durability
      shearing snowman -
      saddling pig -
      using spawn egg on breedable mob -

      How to reproduce (sheep)

      1. Spawn a Sheep
      2. Punch sheep 7 times with bare hands
      3. Punch and shear the sheep at the same time (left and right click quickly)
      4. You will get 4 blocks of wool

      Code analysis

      Based on 1.11.2 decompiled using MCP 9.35 rc1

      The problem is that the method net.minecraft.entity.player.EntityPlayer.interactOn(Entity, EnumHand) does not prevent interaction with dying mobs. Or all methods overriding the method net.minecraft.item.Item.itemInteractionForEntity(ItemStack, EntityPlayer, EntityLivingBase, EnumHand) or net.minecraft.entity.EntityLiving.processInteract(EntityPlayer, EnumHand).

            rockenroll4life rockenroll4life (Josh Letellier)
            TheMinecraftKing Minecraft
            Votes:
            15 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: