Running /loot replace block targeting a shelf block (e.g. minecraft:poplar_shelf) successfully places stackable items (such as minecraft:cookie) into the shelf's slots, but fails to place non-stackable items (such as minecraft:shield, minecraft:enchanted_book, or minecraft:bundle).
By contrast, using /item replace block with the exact same target slot and non-stackable item works as expected, confirming that shelf slots are capable of holding these items via commands.
Steps to Reproduce:
Place any shelf block (e.g.,
minecraft:poplar_shelf) in the world.Run
/loot replacewith a stackable item (control test):/loot replace block <x> <y> <z> container.0 1 loot {pools:[{rolls:1,entries:[{type:"minecraft:item",name:"minecraft:cookie"}]}]}(Observe that the cookie is placed into slot 0 of the shelf.)
Run
/loot replacewith a non-stackable item:/loot replace block <x> <y> <z> container.0 1 loot {pools:[{rolls:1,entries:[{type:"minecraft:item",name:"minecraft:shield"}]}]}Use code with caution.
Check the shelf visually or run
/data get block <x> <y> <z> Items.Run
/item replacewith the same item for comparison:/item replace block <x> <y> <z> container.0 with minecraft:shield
Observed Results:
/loot replacewithminecraft:cookiesucceeds and populates the shelf slot./loot replacewithminecraft:shieldfails to place the item into the shelf (the slot remains empty in both the block model andItemsNBT data)./item replacewithminecraft:shieldsucceeds and places the shield into the shelf slot.
Expected Results:/loot replace should successfully place valid, non-empty loot table rolls—including non-stackable items like shields, enchanted books, and bundles—into shelf block slots, matching the behavior of /item replace and standard containers (like chests or barrels).
Comments 0
No comments.