The Gamepedia and Fandom account systems have now been merged. If your username is incorrect, you have accounts on both platforms that weren't merged, or you have trouble signing in, please submit a support ticket.

Commands/loot

From Minecraft Wiki
Jump to: navigation, search
Information icon.svg
This feature is exclusive to Java Edition.
loot
Restrictions

Operator

First introduced

Java Edition 1.14 (18w43a)

Drops the given loot table into the specified inventory or into the world.

Syntax[edit]

loot <target> <source>
<target>:
spawn <targetPos>
replace entity <entities> <slot> [<count>]
replace block <targetPos> <slot> [<count>]
give <players>
insert <targetPos>
<source>:
fish <loot_table> <pos> [<tool>|mainhand|offhand]
loot <loot_table>
kill <target>
mine <pos> [<tool>|mainhand|offhand]

Arguments[edit]

<loot_table>

Specifies which loot table to use.

<targetPos> or <pos>

Specifies the position of a block or location in the dimension where item drops. May use tilde and caret notation to specify a position relative to the command's execution.

<players>

Specifies one or more players to give. Must be a player name or a target selector.
Entities other than players are not allowed.

<entities>

Specifies one or more entities to modify. Must be a player name, a target selector, or a UUID.
Permits entities other than players.

<slot>

Specifies the inventory slot to be modified. Valid values depend on whether a block or an entity is being modified.
For blocks, must be container.<slot_number> where <slot_number> is replaced with a number specifying the slot.
  • Chests, dispensers, droppers, hoppers, and trapped chests are numbered 0 for the top-left slot and then increase first horizontally, then vertically (so, for example, a chest's top row slots are numbered 0 to 8 from left to right). Double chests and double trapped chests are treated as two single container blocks.
  • A brewing stand's bottom slots are numbered 0 to 2 from left to right, its top slot is 3 and the fuel slot is 4.
  • A furnace's slots are numbered 0 for the input slot, 1 for the fuel slot, and 2 for the output slot.
Other blocks which hold items but don't have inventory GUIs (flower pots and jukeboxes) can be changed only with /data.
For entities, must be one of the following, where <slot_number> is replaced with a number specifying the slot:
Slot Slot Numbers Restrictions
armor.chest armor stands, mobs, and players only (though not all mobs show or make use of the items)
armor.feet
armor.head
armor.legs
weapon.mainhand
weapon.offhand
container.slot_number 0–53 players and minecarts only
enderchest.slot_number 0–26 players only
hotbar.slot_number 0–8
inventory.slot_number 0–26
horse.saddle horses, donkeys, and mules only; item must be a saddle
horse.chest donkeys, and mules only; item must be a chest
horse.armor horses and llamas only; item must be a type of horse armor (if a horse) or a carpet (if a llama)
horse.slot_number 0–14 donkeys and mules with chests only
villager.slot_number 0–7 villagers only
The inventory of an item frame can be changed only with /data.

<count>

Specifies the number of consecutive slots to be filled. Must be between 0 and 2147483647 (inclusive). If the target is a block, <slot_number> + <count> cannot exceed the greatest slot number.

<tool>

Specifies an tool to mine or fish. Must be an item ID or a block ID for which an item exists (for example, minecraft:golden_sword).

<target>

Specifies one entity to kill simulatively. Must be a player name, a target selector, or a UUID.
Permits entity other than players.

Result[edit]

Fails if the arguments are not specified correctly or the specified source entity doesn't have a loot table (for example, players do not have loot tables).

On success, drops items from loot.

See also[edit]

  • /give — give specific items to players without specifying a loot table

History[edit]

Java Edition
1.1418w43aAdded /drop.
18w45aRenamed /drop to /loot.
/loot got reworked.