Commands/loot

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

Syntax

 * Java Edition
 * In which:
 * is:
 * Gives items to players, ignoring empty item stacks.
 * Distributes items to a container block.
 * Spawns item entities.
 * Distributes items to a container block.
 * Distributes items to entities.
 * Spawns item entities.
 * Distributes items to a container block.
 * Distributes items to entities.
 * Distributes items to a container block.
 * Distributes items to entities.
 * Distributes items to entities.


 * is:


 * Bedrock Edition
 * In which:
 * is:
 * Gives items to players, ignoring empty item stacks.
 * Distributes items to a container block, ignoring empty item stacks.
 * Spawns item entities, ignoring empty item stacks.
 * [upcoming: BE 1.19.40]
 * Distributes items to a container block.[upcoming: BE 1.19.40]
 * Distributes items to entities.
 * Spawns item entities, ignoring empty item stacks.
 * [upcoming: BE 1.19.40]
 * Distributes items to a container block.[upcoming: BE 1.19.40]
 * Distributes items to entities.
 * Distributes items to entities.


 * is:

Arguments
esc|je=resource_location}}}}
 * $$, {{lcfirst:{{arg desc
 * Specifies which loot table to use.
 * $$, {{lcfirst:{{arg desc|je=resource_location}}}}
 * $$, {{lcfirst:{{arg desc|be=string}}}} And it refers to a loot table with the path of "loot_tables/ .json".

{{el|je|short=1}}: {{argument|tool|item_stack}}
 * Specifies a tool to mine or fish.
 * {{arg desc|je=item_stack}}

{{el|be|short=1}}: {{argument|be=1|" {{!}}mainhand{{!}}offhand": string|string}}
 * Specifies a tool to be used to kill or loot.
 * {{arg desc|be=string}} Can be  and , otherwise it represents an item id.

{{argument|target|entity|entity: target|actor}} (in  source)
 * Specifies one entity to kill simulatively.
 * {{arg desc|je=entity|amount=single|type=entities|actor}}

{{argument|players|entity|player: target|player}}
 * Specifies one or more players to give.
 * {{arg desc|je=entity|amount=multiple|type=players|be=CommandSelector}}

{{el|je|short=1}}: {{argument|pos|block_pos}} and {{argument|targetPos|block_pos}} (in  and   mode) {{el|be|short=1}}: {{argument|position: x y z|CommandPositionFloat}} (in  mode)
 * Specifies the position of a block.
 * $$: {{lcfirst:{{arg desc|je=block_pos}}}}
 * $$: {{lcfirst:{{arg desc|be=CommandPositionFloat}}}}

{{argument|targetPos|block_pos|position: x y z|CommandPositionFloat}} (in  mode)
 * Specifies the location where item drops.
 * {{arg desc|je=vec3|be=CommandPositionFloat}}

{{argument|entities|entity|entity: target|CommandSelector}}
 * Specifies one or more entities to modify.
 * {{arg desc|je=entity|amount=multiple|type=entities|be=actor}}

{{argument|count|integer|count: int|int}}
 * Specifies the number of consecutive slots to be filled.
 * {{arg desc|je=integer|min=0|be=int}}

{{el|je|short=1}}: {{argument|slot|item_slot}} {{el|be|short=1}}: {{argument|be=1|slotType: EntityEquipmentSlot|enum}} and {{argument|be=1|slotId: int|int}}
 * Specifies the inventory slot to be modified. Valid values depend on what is being modified. See Slot for details.

History
Befehl/loot 命令/loot