mojira.dev
MC-100222

Breeding wolves with rotten flesh causes hunger to player

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.

Linked issues

Comments 26

Can you explane how you did this? For me it is not working and everything seems normal.

Have tamed wolves sitting, hunger bar below full.
Feed rotten flesh to 2 wolves.
Burp sound will commence, 25 seconds of hunger added.

Also, SunCat, how is this a dupe of MC-849 when it doesn't use any extra food, and you aren't eating it yourself?

[Edit] Okay, it /may/ consume an extra piece of rotten flesh, but only sometimes, but doesn't do anything to your own hunger bar when it does, just adding the Hunger status.

I think it's because it is coded in Minecraft that everytime you use rotten flesh (or maybe another food), you take the effect of it even if you use it to feed wolves/ocelots/other pets.

That to me sounds like an issue that would need addressed.
If you eat something and you die, it's poisonous.
If something bites you and you die, it's venomous.
If something eats something and you die (or get sick), that's correlation without causation. Or voodoo.

16 more comments

Confirmed for 18w32a

Confirmed for 18w33a

Confirmed for 1.13.1-pre1

Seem to be fixed in pre3.

Cannot reproduce this either in 1.15-pre3 using the described reproduction steps. Resolved it as fixed.

AceMcCrank

(Unassigned)

Confirmed

(Unassigned)

breeding, hunger, player, rotten_flesh, wolf

Minecraft 1.9, Minecraft 1.9.1, Minecraft 1.9.2, Minecraft 16w14a, Minecraft 16w15b, ..., Minecraft 18w50a, Minecraft 19w12b, Minecraft 19w13b, Minecraft 19w14a, Minecraft 19w14b

1.15 Pre-release 3

Retrieved