The bug
You can feed hay bales to adult donkeys, horses or mules, but hand animation and animal eating animation/sounds are not played.
The distinction of this issue from MC-93825 is that it is NOT a desync, and it is not MC-233276 as it happens regardless of the animal's temper value, and no other food exhibits this behavior, only hay bales. Also unlike MC-233276, this does not affect llamas.
To reproduce
1. Summon a donkey, horse or mule.
2. Feed the animal hay bales.
3. ❌ The hay bales will be consumed, but no animations or sounds are played.
Expected result
Animations and sounds should be played when you feed hay bales to adult donkeys, horses and mules, or adult donkeys, horses and mules should not consume hay bales to begin with, in line with how they used to behave in the past (see this comment).
Code analysis (tentative)
If adult donkeys, horses and mules should consume the hay bales:
There appears to be a missing line in AbstractHorse.java
:
net.minecraft.world.entity.animal.horse.AbstractHorse.java (Mojang mappings, 1.18-pre1)
...
protected boolean handleEating(Player $$0, ItemStack $$1) {
boolean $$2 = false;
float $$3 = 0.0f;
int $$4 = 0;
int $$5 = 0;
if ($$1.is(Items.WHEAT)) {
$$3 = 2.0f;
$$4 = 20;
$$5 = 3;
}
...
else if ($$1.is(Blocks.HAY_BLOCK.asItem())) {
$$3 = 20.0f;
$$4 = 180;
/** There should be a $$5 here? */
}
...
else if ($$1.is(Items.GOLDEN_CARROT)) {
$$3 = 4.0f;
$$4 = 60;
$$5 = 5;
...
}
...
if ($$5 > 0 && ($$2 || !this.isTamed()) && this.getTemper() < this.getMaxTemper()) {
$$2 = true;
if (!this.level.isClientSide) {
this.modifyTemper($$5);
}
}
if ($$2) {
this.eating();
this.gameEvent(GameEvent.EAT, this.eyeBlockPosition());
}
The variable $$5
appears to control the Temper
and the eating event, and it is missing for the hay bale. Llamas override this method in their own class, which would explain why they are not affected.
If they should not consume the hay bales:
Code analysis by @unknown can be found in this comment.
Related issues
is duplicated by
relates to
Attachments
Comments


And I think the reason llamas are not affected is because they override this method in their own class.

Dupe of MC-233276

It's not a duplicate. I stated in the description the reason why they are separate issues. They are marked as related.

I looked into this issue more, and it turns out the handleEating method returns correctly (it returns if the feeding action succeeded), so the error is caused by fedFood. See below how the ItemStack always decrements regardless if the feeding action succeeds or not. This affects all llamas, donkeys, mules, and horses, tamed or untamed.
[media]

On the Minecraft wiki it states that horses, mules, and donkeys cannot accept hay bales if untamed. If this is intended, then $$5 should be excluded from hay bales, meaning that the issue here is that the hay bales were incorrectly consumed, as a result of the analysis I attached.

The Minecraft wiki is not a source for intended behavior, as it is not considered an official source anymore. However, you could be right that it might be intended. I'll add this to the summary.

This has been fixed in 23w41a with the fix of MC-233276.