/loot Command
Drops or distributes items generated by a loot table into the world, an inventory, or a container. Destinations control where items go; sources control what loot table governs the drops, optionally simulating fishing, entity death, or block mining (including tool enchantment effects).
Syntax
Targets (destinations):
loot give <players> <source>
loot insert <targetPos> <source>
loot spawn <targetPos> <source>
loot replace entity <entities> <slot> [<count>] <source>
loot replace block <targetPos> <slot> [<count>] <source>
Sources:
fish <loot_table> <pos> [<tool>|mainhand|offhand]
loot <loot_table>
kill <entity>
mine <pos> [<tool>|mainhand|offhand]Permission: 2Edition: Java
Examples
loot give @p loot minecraft:chests/end_city_treasureloot spawn ~ ~1 ~ kill @e[type=zombie,limit=1,sort=nearest]loot insert ~ ~ ~ mine ~ ~-1 ~ diamond_pickaxeloot replace entity @p weapon.mainhand loot minecraft:entities/guardianNotes
Exclusive to Java Edition. When using the `fish` source, the position specifies where the fishing occurs, affecting biome-dependent fish tables. The `mine` source respects Fortune and Silk Touch on the specified tool. `replace` with a `[<count>]` argument limits how many slots are filled. Since 1.21, loot tables can also be specified inline as SNBT compound tags instead of a resource location.