The bug
Horses being ridden by another player or entity can be saddled by right-clicking on them while holding a saddle. This is likely unintended as:
opening/interacting with the inventory of a ridden horse is otherwise disabled for all players except the rider,
this issue doesn't affect horse armour, and
this issue doesn't affect llamas being equipped with carpets.
How to reproduce
Summon a tamed horse ridden by an entity:
/summon horse ~ ~ ~ {Tame:1,Passengers:[{id:chicken}]}
Attempt to open the horse's inventory by right-clicking on it while sneaking
→ ✔ The horse's inventory cannot be accessed by you, as you are not the riderWithout sneaking, right-click on the horse while holding a saddle
→ ❌ The horse is equipped with the saddle
Code analysis
Code analysis by @unknown can be found in this comment.
Linked issues
causes 1
Comments 7
This issue still exists in Minecraft 1.19.4 pre-release 1. In addition, it affects all saddleable entities.
Code analysis (Yarn mappings)
Each implementation of the Saddleable#canBeSaddled
method does not check the entity's passengers.
The suggested fix would be to check the Entity#hasPassengers
method within each implementation of the Saddleable#canBeSaddled
method. For example:
@Override
public boolean canBeSaddled() {
return this.isAlive() && !this.isBaby() && this.isTame() && !this.hasPassengers();
}
Can confirm for 1.16.4-pre2