Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Commands/loot

From SAS Gaming Wiki
Revision as of 22:21, 29 December 2025 by 2600:1700:71e0:3100:bdd7:7839:18b5:6b90 (talk) (Syntax: added "mine" source for Bedrock)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Template:Infobox command

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

Syntax

  • Java Edition
loot <TARGET> <SOURCE>
In which:
<TARGET> is:
give <players>
Distributes items to players, ignoring empty item stacks.
insert <targetPos>
Distributes items to a container block, ignoring empty item stacks.
spawn <targetPos>
Spawns item entities. Empty item stacks are also spawned, but disappear instantly.
replace block <targetPos> <slot>
replace entity <entities> <slot>
Replaces item stacks into some consecutive Minecraft:slots in order. An empty item stack generated by the <SOURCE> clears a slot.
replace block <targetPos> <slot> <count>
replace entity <entities> <slot> <count>
Clears some consecutive Minecraft:slots, and then places item stacks into them in order. Empty item stacks are also placed. If the number of item stacks generated by the <SOURCE> exceeds the specified slot number, excess item stacks are ignored.
<SOURCE> is:
fish <loot_table> <pos> [<tool>|mainhand|offhand]
Simulates Minecraft:fishing with a specified tool at a specified position.
loot <loot_table>
Invokes a Minecraft:loot table directly.
kill <target>
Simulates killing a specified entity.
mine <pos> [<tool>|mainhand|offhand]
Simulates mining a block at a specified position with a specified tool.
Minecraft:Loot context provided by each <SOURCE> is:
  • Bedrock Edition
loot <TARGET> <SOURCE>
In which:
<TARGET> is:
give <player: target>
Gives items to players, ignoring empty item stacks.
insert <position: x y z>
Distributes items to a container block, ignoring empty item stacks.
spawn <position: x y z>
Spawns item entities, ignoring empty item stacks.
replace block <position: x y z> slot.container <slotId: int>
replace entity <entity: target> <slotType: EntityEquipmentSlot> <slotId: int>
Replaces item stacks into some consecutive Minecraft:slots in order. An empty item stack generated by the <SOURCE> clears a slot.
replace block <position: x y z> slot.container <slotId: int> [count: int]
replace entity <entity: target> <slotType: EntityEquipmentSlot> <slotId: int> [count: int]
Clears some consecutive Minecraft:slots, and then places item stacks into them in order. Empty item stacks are also placed. If the number of item stacks generated by the <SOURCE> exceeds the specified slot number, excess item stacks are ignored. An entity or a container must have all the specified consecutive slots in order to clear and place items in it.
<SOURCE> is:
kill <entity: target> ["<tool>|mainhand|offhand": string]
Simulates killing a specified entity with a specified tool.
loot <loot_table: string> ["<tool>|mainhand|offhand": string]
Invokes a Minecraft:loot table with a specified tool.
mine <TargetBlockPosition: x y z> ["<tool>|mainhand|offhand": string]
Simulates mining the block at the designated position with a specified tool.

Arguments

Template:El: Template:Argument

Template:El: Template:Argument

Specifies which loot table to use.
Template:IN, Template:Arg desc
Template:IN, Template:Arg desc And it refers to a loot table with the path of "loot_tables/loot_table: string.json".

Template:El: Template:Argument

Specifies a tool to simulatively mine or fish.
Template:Arg desc

Template:El: Template:Argument

Specifies a tool to be used to simulatively kill or loot.
Template:Arg desc Can be mainhand and offhand, otherwise it represents an item id.

Template:Argument (in kill source)

Specifies one entity to kill simulatively.
Template:Arg desc

Template:Argument

Specifies one or more players to give.
Template:Arg desc

Template:El: Template:Argument and Template:Argument (in replace block and insert mode)
Template:El: Template:Argument (in replace block and insert mode)

Specifies the position of a block.
Template:IN: Template:Arg desc
Template:IN: Template:Arg desc

Template:Argument (in spawn mode)

Specifies the location where item entities drop.
Template:Arg desc

Template:Argument

Specifies one or more entities to modify.
Template:Arg desc

Template:Argument

Specifies the number of consecutive slots to be cleared.
Template:Arg desc

Template:El: Template:Argument
Template:El: Template:Argument, slot.container, and Template:Argument

Specifies the inventory slot to be modified.
Template:Arg desc

Result

Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table

Output

Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table

History

Java Edition

Template:HistoryTable

Bedrock Edition

Template:HistoryTable

See also

External links

Navigation

Template:Navbox commands

Minecraft:de:Befehl/loot Minecraft:es:Comandos/loot Minecraft:ja:コマンド/loot Minecraft:ko:명령어/loot Minecraft:pt:Comandos/loot Minecraft:ru:Команды консоли/loot Minecraft:uk:Команди консолі/loot Minecraft:zh:命令/loot