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

Breeding wolves with rotten flesh causes hunger to player

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reopened
    • Resolution: Unresolved
    • Affects Version/s: Minecraft 1.9, Minecraft 1.9.1, Minecraft 1.9.2, Minecraft 16w14a, Minecraft 16w15b, Minecraft 1.9.3 Pre-Release 2, Minecraft 1.9.4, Minecraft 16w20a, Minecraft 1.11, Minecraft 1.12, Minecraft 1.12.2, Minecraft 1.13-pre8, Minecraft 1.13, Minecraft 18w30b, Minecraft 18w31a, Minecraft 18w32a, Minecraft 18w33a, Minecraft 1.13.1-pre1, Minecraft 1.13.1, Minecraft 1.13.2, Minecraft 18w45a, Minecraft 18w46a, Minecraft 18w48a, Minecraft 18w48b, Minecraft 18w49a, Minecraft 18w50a
    • Fix Version/s: None
    • Confirmation Status:
      Confirmed

      Description

      The bug

      Using rotten flesh to breed wolves, upon a successful breeding, will cause the player who caused the breeding to have 25 seconds of hunger.

      This is new to me for 1.9.

      How to reproduce

      1. Make sure you are in survival mode and don't have full hunger bar
      2. Hurt a tamed wolf
      3. Right click the wolf twice (after the second click hearts should appear)
      4. Wait
        → Hunger is applied

      Code analysis

      The following is based on decompiled version of Minecraft 1.9 using MCP 9.24 beta. All method and class names are the names used in the decompiled version.

      It looks like there are multiple problems which cause this bug. One is that the item in use and the item in the selected slot are not the same item object (see also MC-86252 and this comment). This causes the method net.minecraft.entity.EntityLivingBase.func_184608_ct() to reset the item in use. It should however as well send the action to the server net.minecraft.network.play.client.CPacketPlayerDigging.Action.RELEASE_USE_ITEM. The second problem is that the item in use and the item in the hotbar are desynced (client side), this can be seen when you right click the wolf, the first right click does nothing but consumes one rotten flesh, only the second one creates the hearts. This causes then later the method net.minecraft.entity.EntityLivingBase.func_184608_ct() to reset the item in use, because the item in use still has still the old count whereas the selected item has already the new count.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                AceMcCrank Aaron Atkins
              • Votes:
                10 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  CHK: