Using a loot bag on a chest leaves a ghost item behind
TheDeviantCrafter opened this issue ยท 2 comments
When you shift + right click on a chest with a loot bag, it dumps the items inside the bag into the chest. The loot bag then disappears.
When this is done in an Auto Clicker, it drops the items into a chest, but doesn't delete the item. Instead it creates a ghost item, which exists until a player manually grabs it from the Auto Clicker's inventory. Once the player does this, the item disappears.
This isn't just a client-server desync. While the ghost item exists, no new items can be inserted via hoppers.
After a bit of extra testing, the ghost item can actually be moved around via hoppers. It only deletes itself when picked up by an actual player. I suspect this is done by Loot Bags.
Using Tell Me to read the NBT data on a hopper containing this ghost item, it contains five item stacks all set to air. The item is supposed to delete itself once all of the inventory slots are empty, but it can't do this inside an Automatic User.
The item is responsible for deleting itself, and should generally be done when the items are removed from the lootbag.
However, lootbags only tries to remove the bag from an inventory when it is in a player's inventory, as it uses Item#onUpdate
to check (each tick in a player inv) if the bag is empty.
This is a bug on the other mod's end, as they should be shrinking the bag when the bag is emptied, not checking every tick.