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
In creative mode, summon a horse.
Tame the horse and name it.
Put golden apple in your hotkey.
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
is duplicated by
relates to
Attachments
Comments


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

Confirmed for 16w06a

Wrong "relates to" link. MC-90118 is marked as duplicate
Still in 16w21b. Also works with golden carrots.

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.

confirmed for 1.11.2.

Still an issue in Minecraft 1.12.

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
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.

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

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.