
Command
/loot
Generates items from a loot table, a mob's drops, a block's drops or a fishing catch and puts them in a player's inventory, a container, an entity's slots or on the ground.
| /loot (give <players>|insert <targetPos>|spawn <targetPos>) fish <loot_table> <pos> |
| /loot (give <players>|insert <targetPos>|spawn <targetPos>) fish <loot_table> <pos> (mainhand|offhand) |
| /loot (give <players>|insert <targetPos>|spawn <targetPos>) fish <loot_table> <pos> <tool> |
| /loot (give <players>|insert <targetPos>|spawn <targetPos>) (kill <target>|loot <loot_table>) |
| /loot (give <players>|insert <targetPos>|spawn <targetPos>) mine <pos> |
| /loot (give <players>|insert <targetPos>|spawn <targetPos>) mine <pos> (mainhand|offhand) |
| /loot (give <players>|insert <targetPos>|spawn <targetPos>) mine <pos> <tool> |
| /loot replace (block <targetPos>|entity <entities>) <slot> <count> fish <loot_table> <pos> |
| /loot replace (block <targetPos>|entity <entities>) <slot> <count> fish <loot_table> <pos> (mainhand|offhand) |
| /loot replace (block <targetPos>|entity <entities>) <slot> <count> fish <loot_table> <pos> <tool> |
| /loot replace (block <targetPos>|entity <entities>) <slot> <count> (kill <target>|loot <loot_table>) |
| /loot replace (block <targetPos>|entity <entities>) <slot> <count> mine <pos> |
| /loot replace (block <targetPos>|entity <entities>) <slot> <count> mine <pos> (mainhand|offhand) |
| /loot replace (block <targetPos>|entity <entities>) <slot> <count> mine <pos> <tool> |
| /loot replace (block <targetPos>|entity <entities>) <slot> fish <loot_table> <pos> |
| /loot replace (block <targetPos>|entity <entities>) <slot> fish <loot_table> <pos> (mainhand|offhand) |
| /loot replace (block <targetPos>|entity <entities>) <slot> fish <loot_table> <pos> <tool> |
| /loot replace (block <targetPos>|entity <entities>) <slot> (kill <target>|loot <loot_table>) |
| /loot replace (block <targetPos>|entity <entities>) <slot> mine <pos> |
| /loot replace (block <targetPos>|entity <entities>) <slot> mine <pos> (mainhand|offhand) |
| /loot replace (block <targetPos>|entity <entities>) <slot> mine <pos> <tool> |
| Argument | Kind of value | What to type |
|---|---|---|
| <players> | Target selector | For give: the players who receive the items. One or more players. |
| <loot_table> | Loot table | For loot and fish: the loot table to roll, as an id such as minecraft:chests/simple_dungeon or as an inline loot table definition. |
| <pos> | Block position | For mine: the block whose drops are generated. For fish: the position where the fishing takes place. |
| <tool> | Item | For mine and fish: the item used as the tool, for example minecraft:diamond_pickaxe. The literals mainhand and offhand can be used instead. |
| <target> | Target selector | For kill: the single entity whose drops are generated. One entity only. |
| <targetPos> | Block position | For insert and replace block: the position of the container. For spawn: the exact coordinates where the items are dropped. |
| <slot> | Item slot | For replace: the first slot to fill, for example container.0 to container.53, hotbar.0 to hotbar.8, inventory.0 to inventory.26, weapon.mainhand, weapon.offhand, armor.head, armor.chest, armor.legs, armor.feet. |
| <count> | Whole number | For replace: how many slots to write, 0 or more. Left out, it equals the number of generated stacks. At least 0. |
| <entities> | Target selector | For replace entity: the entities whose slots are filled. One or more entities. |
| Permission level | 2: operators, worlds with cheats on, command blocks and functions |
| Works in | Singleplayer with cheats enabled, operators on multiplayer servers, command blocks and functions. |
| Result | Reports "Dropped <count> <item>" when one item stack was delivered, otherwise "Dropped <number> items"; the kill and mine sources also name the loot table that was used. The number /execute store saves is the number of item stacks that were delivered (0 if nothing was generated or nothing fit). |
| Structure | The command is always a target followed by a source: first where the items go (give, insert, spawn, replace block, replace entity), then where they come from (loot, kill, mine, fish). |
| Target: give | Adds every generated stack to the inventory of each chosen player. Items that do not fit are not dropped on the ground. |
| Target: insert | Distributes the items into the container at the position, filling empty slots and topping up matching stacks. Fails with "Target position is not a container" if the block has no inventory. |
| Target: spawn | Drops the items as item entities at the position, with the normal pickup delay. |
| Target: replace | Writes the items into consecutive slots of a container block or of one or more entities, starting at the given slot. Without a count, as many slots are written as stacks were generated. With a count, exactly that many slots are written, and slots beyond the generated loot are emptied. |
| Source: loot | Rolls the given loot table the way a chest would, at the position the command runs from. |
| Source: kill | Generates what the chosen entity would drop if killed, without harming it. Whoever runs the command counts as the killer, so a player running it gets player-kill drops. Fails if the entity has no loot table. |
| Source: mine | Generates what the block at the position would drop if mined, without breaking it. With no tool it is mined bare-handed; mainhand and offhand use the item held by whoever runs the command; an item id uses that item as the tool. Fails if the block has no loot table. |
| Source: fish | Rolls a loot table as a fishing catch at the given position, optionally with a tool (an item id, mainhand or offhand). |
| Hand items | mainhand and offhand only work when the command is run by a living entity; otherwise it fails with "Entity can't hold any items". |
| Loaded positions | Every block position used must be in a loaded part of the world, or the command fails with "That position is not loaded". |
/loot give @s loot minecraft:chests/simple_dungeonRolls the dungeon chest loot table and puts the items in your inventory.
/loot spawn ~ ~1 ~ kill @e[type=minecraft:zombie,limit=1,sort=nearest]Drops the loot of the nearest Zombie one block above you without killing it.
/loot give @p mine ~ ~-1 ~ mainhandGives the nearest player what the block below would drop when mined with the item in your main hand.
/loot insert ~ ~-1 ~ loot minecraft:chests/desert_pyramidFills the container below you with Desert Pyramid chest loot.
/loot replace block ~ ~-1 ~ container.0 27 loot minecraft:chests/end_city_treasureOverwrites the 27 slots of the chest below you with End City treasure, emptying the slots that get no item.
/loot replace entity @s hotbar.0 9 fish minecraft:gameplay/fishing ~ ~ ~ minecraft:fishing_rodReplaces your hotbar with a fishing catch made with a Fishing Rod at your position.



