When you break a hopper or chest minecart or chest boat, or kill a chested donkey, lllama, or mule, any items in its inventory drop along with the cart/boat variant or chest, as the case may be. The cart/boat item entity itself spawns at the exact position the cart/boat entity was located at before breaking, and the chest of a chested animal appears at +1Y of the animal's position before killing. By contrast, the items that the entity contained spawn near +0.5 X, +0.5 Z, of the exact position the entity was located at before breaking, and in the case of carts/boats +0.5Y as well. This makes it very difficult to create reliable collection systems for container entities and their items. For example, if you break a chest/hopper-minecart that is in an enclosed 1 x 1 chamber, some of its items may spawn inside the enclosing wall and glitch out of the chamber.
Note: this issue may seem related to MCPE-93783, but that report concerns the minecart itself and that issue is caused by an interaction between random item drop momentum and the incorrect collection range of hoppers. This report is about the items in the inventory of the a storage minecart and has nothing to do with the random momentum of item drops.
Steps to reproduce
Load
. This world has 5 congruent test setups with signs explaining how to use. In each test, items are made to drop from killing/breaking a storage entity or block, the item entity locations are marked with a green particle, and then the items are killed.
Run the first test (hopper minecart) without adding items, in order to see where the hopper minecart itself drops.
Run the first test again adding the item.
Run the tests for chest minecart, chest boat, donkey, and hopper multiple times for comparison. For the donkey, compare it chested with and without an item inside, and for the hopper compare it with and without an item inside.
Expected result
When a storage entity is broken/killed, item drops from its inventory would spawn near the same spot as the item drop representing the entity itself, and centered at least on the X and Z axes.
Observed result
Items from the inventory of a hopper/chest minecart and chest boat spawn near +0.5 X, +0.5 Y, +0.5 Z of the position where the cart/boat item spawns. The cart/boat itself drops at its center (= its exact position).
Items from a chested donkey's inventory spawn at Y = 0 and between +0 and +0.5X, Z relative to the donkey's position, while the chest spawns at +1Y and centered horizontally.
Linked issues
is duplicated by 1
relates to 1
Attachments
Comments 1

Based on the hopper test in the test world, the behavior of inventory drops from container blocks seems to be that both the item entity representing the container block (the hopper), and the item entities representing the inventory of the container, spawn at a random position within the space that the block occupied. For container entities, it would be similar to have inventory items and the cart/boat item spawn at a random position within the AABB of the former entity. However, that would add extra coding and extra computations for the game with seemingly little purpose, since all of the item entities get random momentum anyway.
The current behavior of the chest dropping from from a chested donkey (+1 Y, centered X, Z) makes sense because it matches the visual position of the chest on the donkey. I would expect the inventory items to drop from the same spot.
The current behavior of the minecart/boat itself dropping from its center (which = their exact position, unlike other entities) seems fine. It might be preferred by some players to have the cart inventory drop higher than the cart itself, near the top of the entity, to make sorting the minecart from its inventory easier, but any drop spawning outside the AABB could cause unexpected glitching through blocks.