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
Make sure you are in survival mode and don't have full hunger bar
Hurt a tamed wolf
Right click the wolf twice (after the second click hearts should appear)
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.
Related issues
Comments

Dupe of MC-849

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.

I think this would be part of the well known eating bug where after you've eaten the animation continues and it takes double as long to eat. So for some reason, the code will trigger the "consume food" method twice. I guess one for the entity that gave the food and another one for the entity that ate the food. They probably didn't thought of the fact that you can feed wolves too. I assuming this uses a different method for breeding.
is would explain both bugs. The player itself eats and feed and when you feed the wolves, the game thinks you've eaten the rotten flesh as well.
I might be completely wrong, but this is how I would explain this bug without knowing the code.

Confirmed for 16w14a
I agree, I would like this fixed. I like to use rotten flesh to feed the wolves because, well it has no other purpose unless you are starving lol. Even when I right click on something with food in my hand, I accidentally eat food when I don't want to. Also while eating food, sometimes you will consume one more a second or two after you're done wanting to eat anymore. It's kind a weird since I stopped pressing the button like a whole 2 seconds ago. Random burps i thought was funny until i realized it was stealing food that I didn't want to be consumed. I had one carrot that a zombie dropped, so i am glad that I didn't actually consume it... Since I have yet to find a village. It really only happens while feeding them.

Please link to this comment in the description
How to reproduce
Hurt tamed wolf
Right click the wolf twice (after the second click hearts should appear)
Wait
→ Hunger is applied
The reason
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.
Confirmed for 16w15a and 16w15b
Confirm for 1.9.3 pre-2
Confirmed for 1.9.4
Confirmed for 16w20a
Is this still an issue in the latest snapshot 16w44a? If so please update the affected versions.
This is an automated comment on any open or reopened issue with out-of-date affected versions.

Is this still an issue in the most recent versions (currently that is 1.11) of Minecraft? If so, please update the affected versions and help us keeping this ticket updated from time to time. If you are the owner/reporter of this ticket, you can modify the affected version(s) yourself.

I can confirm this still happens in 1.11.
I can confirm this is happening in 1.12.2. Breeding/Healing wolves with rotten flesh/raw chicken causes the player to eat it and have the hunger status (if below full hunger)
Confirmed for 1.13-pre8
Confirmed for 1.13
Confirmed for 18w30b
Confirmed for 18w31a

I would like to add that it isn't just rotten flesh. The whole right clicking thing is sensitive. Especially when you have something in your off hand. But if you don't hold the right click long enough you won't eat but it ends up shoving other things either in your mouth or a block on the floor.. lol made me jump a few times. I didn't try the snapshots but 1.13 this is an issue. I didn't know if this bug included what I mentioned.
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.
Can you explane how you did this? For me it is not working and everything seems normal.