When the minecraft:rideable
component’s seat position is greater than 5 blocks from the entity’s position, the mob’s inventory closes immediately when opened. I assume this is related to the inventory of a mob or chest automatically closing when the player becomes more than 5 blocks from it. While I obviously don’t know much about the source code of Bedrock Edition, perhaps a fix would be an exemption to closing an inventory because of distance if the inventory is of the mob being ridden.
Steps to Reproduce:
Add the attached pack to a world. This pack changes the vanilla horse’s rideable component to put the player more than 5 blocks from the entity’s center. Looking at the screenshot of the code that is attached, notice that even though each coordinate is less than 5, you can use Pythagorean Theorem to find that the player is in fact more than 5 blocks from 0,0,0.
Mount a horse until it is broken
Try to open the horse’s inventory
Expected Behavior:
The horse’s inventory opens, allowing you apply a saddle and horse armor and rearrange your own inventory
Actual Behavior:
The horse’s inventory opens and instantly closes.
This affects Preview 1.21.100.20