Minecraft Wiki

The Minecraft Wiki is no longer considered as official by Microsoft and therefore several changes are required to be made, including to the wiki's logo. Please read this announcement for more information.

READ MORE

Minecraft Wiki
Advertisement
Minecraft Wiki
loot
Permission level
required

2

Restrictions

Cheat only‌[BE only]

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

Syntax[]

  • Java Edition
loot <TARGET> <SOURCE>
In which:
<TARGET> is:
spawn <targetPos>
Spawns item entities.
replace entity <entities> <slot> [<count>]
Distributes items to entities.
replace block <targetPos> <slot> [<count>]
Distributes items to a container block.
give <players>
Gives items to players, ignoring empty item stacks.
insert <targetPos>
Distributes items to a container block.
<SOURCE> is:
fish <loot_table> <pos> [<tool>|mainhand|offhand]
loot <loot_table>
kill <target>
mine <pos> [<tool>|mainhand|offhand]
  • Bedrock Edition
loot spawn <position: x y z> loot <loot_table: string> [<tool>:mainhand:offhand: string]

Arguments[]

JE: <loot_table>: resource_location
BE: <loot_table: string>: string

Specifies which loot table to use.
Must be a resource location.

JE: <pos>: block_pos and <targetPos>: block_pos (in replace block and insert mode)

Specifies the position of a block.
It must be a block position composed of <x>, <y> and <z>, each of which must be an integer or a tilde and caret notation.

JE: <targetPos>: block_pos (in spawn mode)

Specifies the location where item drops.
Must be a three-dimensional coordinates with floating-point number elements. Accepts tilde and caret notations.

JE: <entities>: entity

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

JE: <players>: entity

Specifies one or more players to give.
Must be a player name, a target selector or a UUID. And the target selector must be of player type.

JE: <tool>: item_stack

Specifies a tool to mine or fish.
It must be in form of item_id{data_tags}(accepts item and block tags), in which data tags can be omitted when they are not needed.

JE: <target>: entity

Specifies one entity to kill simulatively.
Must be a player name, a target selector or a UUID. And the target selector must be of single type.

JE: <count>: integer

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

JE: <slot>: item_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, item frames (slot 0), 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

Result[]

CommandTriggerJava Edition
anythe arguments are not specified correctly Unparseable
/... fish ...
/... mine ...
<pos> is unloaded or out of the world Failed
/... mainhand
... offhand
the executor is not a living entity
/... kill ...<target> fails to resolve to a single entity (named player must be online)
/loot replace entity ...<entities> fails to resolve to one or more entities (named player must be online)
/loot give ...<players> fails to resolve to one or more online players
/... kill ...the <target> is not a living entity
/loot insert ...
/loot replace block ...
<targetPos> is unloaded or out of the world
the block at <targetPos> is not a container
/loot replace block ...the block does not have the specified <slot>
/loot replace block <targetPos> <slot> ...the number of item stacks got from loot plus the <slot> id is bigger than the number of all slots in the specified container Error
/loot replace block <targetPos> <slot> <count> ...the <count> plus the <slot> id is bigger than the number of all slots in the specified container
anyOn successDrops the given loot table into the specified inventory or into the world.

Output[]

CommandEditionSituationSuccess Count/execute store success .../execute store result ...
anyJava EditionOn fail000
/loot spawn ...On success11the number of item stacks got from loot
/loot give ...On success11the total number of item stacks successfully allocated to each player
/loot insert ...On success11the number of item stacks successfully distributed to the container
/loot replace block ...On success11the number of item stacks successfully distributed to the container
On error0unchangedunchanged
/loot replace entity ...On success11the total number of item stacks successfully allocated to each entity
On error0unchangedunchanged

See also[]

  • /give — give specific items to players without specifying a loot table
  • /item — modify specific item slots of entities or container

History[]

Java Edition
1.1418w43aAdded /drop.
18w45aRenamed /drop to /loot.
/loot got reworked.
Upcoming Bedrock Edition
1.18beta 1.18.0.21Added /loot.
Advertisement