mojira.dev
MC-88230

When feeding a tamed horse or llama with a golden apple/carrot or hay bale, the cursor moves to the right

The bug

When I was feeding my horses with golden apple, which are tamed and named, I expected that they would just open their mouths to show happiness. But the cursor instantly moved to the right, moving out of focus. I did not see if they accepted the apple.

How to reproduce

  1. In creative mode, summon a horse.

  2. Tame the horse and name it.

  3. Put golden apple in your hotkey.

  4. Right-click the horse while the golden apple is in hand.

Note that this is not MC-61535.

Code analysis

Code analysis by @unknown can be found in this comment.

Suggested fix by @unknown can be found in

[media]

; explanation can be found in this comment.

Related issues

Attachments

Comments

migrated
[media][media][media]
marcono1234

Confirmed for

  • 15w49b Seems like the player mounts the horse and gets instantly dismounted

SunCat

Confirmed for 16w06a

marcono1234

Wrong "relates to" link. MC-90118 is marked as duplicate

violine1101

Still in 16w21b. Also works with golden carrots.

marcono1234

Please link to this comment in the description

The following is based on a decompiled version of Minecraft 1.9 using MCP 9.24 beta.

The reason why this is happens is the same as for MC-93826. Because for the client the returned growing age is never 0, the client thinks it could not feed to horse with a golden carrot or golden apple to have it enter the love mode. Therefor client-side the player mounts the horse. The actual riding is only done server-side, however the look adjustment to look in the same direction the horse does, is done client-side as well.
Because the player used the item successfully server-side he will not start riding the horse.

migrated

confirmed for 1.11.2.

migrated

Still an issue in Minecraft 1.12.

migrated

The bug happens because growingAge variable is constantly set to 1 on the client instead of decrementing all the way down to 0 as on the server. The flag never sets to true on the client making the client think that it needs to ride the lama instead of just feeding the lama.

As this bug persists across all animals that have inventory's like donkeys or mules it might be best to fix the issue at the root in the class "AbstractChestHorse.java".
http://i.imgur.com/i0ocILF.png
Best way to fix the bug is to force the player to never mount animals when holding food in the main hand. This will fix all bugs related to breeding across all animals that have inventory's including lamas and when the animal can't be bread the food wont be wasted.

While on the subject of lama breeding it might be worth mentioning that the check to overfeed already bread lamas is missing. Adding this additional if check will result in not feeding a lama that already have been fed and put into love mode.
http://i.imgur.com/y6vkAk1.png

gnembon

Like Xcom explained, I added suggested change in the Attachments. This is only proof of concept solution. Since Llamas and Donkeys as subclasses that use different breeding food items, it is recommended that the call to isValidBreedItem is left abstract in the AbstractChestHorse and is defined as true for Hay blocks in Llama class and true for golden carrots and golden apples for example for Donkeys. Only breedable food items need to be specified.

migrated

In 1.13-pre3, the bug is resurrected from the dead! D:

violine1101

Reopened.

pokechu22

Ah, this actually existed in earlier snapshots (I know at least pre1) but I didn't spot the ticket during testing. I'll try to figure out which version it first resurfaced in.

migrated

migrated

Confirmed

breeding, feeding, golden_apple, golden_carrot, hay_bale, horse, llama, rotation

Minecraft 15w36d, Minecraft 15w44b, Minecraft 15w46a, Minecraft 15w49b, Minecraft 16w06a, ..., Minecraft 1.13-pre3, Minecraft 1.13-pre10, Minecraft 1.13, Minecraft 18w30b, Minecraft 18w31a

Minecraft 17w48a, Minecraft 18w32a

Retrieved