Minecraft:Commands/loot: Difference between revisions
More actions
→Syntax: added "mine" source for Bedrock |
Remove broken links to missing pages |
||
| Line 4: | Line 4: | ||
* 2 {{only|java|short=1}} | * 2 {{only|java|short=1}} | ||
* 1 {{only|bedrock|short=1}} | * 1 {{only|bedrock|short=1}} | ||
|others= | |others=Cheats only{{only|bedrock|short=1}} | ||
}} | }} | ||
Drops the given | Drops the given loot table into the specified inventory or into the world. | ||
==Syntax== | ==Syntax== | ||
| Line 29: | Line 29: | ||
::<code><''SOURCE''></code> is: | ::<code><''SOURCE''></code> is: | ||
::: <code>fish <loot_table> <pos> [<tool>|mainhand|offhand]</code> | ::: <code>fish <loot_table> <pos> [<tool>|mainhand|offhand]</code> | ||
:::: Simulates | :::: Simulates fishing with a specified tool at a specified position. | ||
::: <code>loot <loot_table></code> | ::: <code>loot <loot_table></code> | ||
:::: Invokes a | :::: Invokes a loot table directly. | ||
::: <code>kill <target></code> | ::: <code>kill <target></code> | ||
:::: Simulates killing a specified entity. | :::: Simulates killing a specified entity. | ||
| Line 37: | Line 37: | ||
:::: Simulates mining a block at a specified position with a specified tool. | :::: Simulates mining a block at a specified position with a specified tool. | ||
: | ::Loot context provided by each <code><''SOURCE''></code> is: | ||
:::{|class="wikitable collapsible collapsed | :::{|class="wikitable collapsible collapsed | ||
! <''SOURCE''> !! Supplied loot context parameters | ! <''SOURCE''> !! Supplied loot context parameters | ||
| Line 51: | Line 51: | ||
* '''{{cd|this}} entity:''' The specified entity. | * '''{{cd|this}} entity:''' The specified entity. | ||
* '''Origin:''' The command execution position. | * '''Origin:''' The command execution position. | ||
* '''Damage source:''' The <code>magic</code> | * '''Damage source:''' The <code>magic</code> damage type | ||
* '''{{cd|attacker}} entity:''' (If the executor is an entity) The command executor entity. | * '''{{cd|attacker}} entity:''' (If the executor is an entity) The command executor entity. | ||
* '''{{cd|direct_attacker}} entity:''' (If the executor is an entity) The command executor entity. | * '''{{cd|direct_attacker}} entity:''' (If the executor is an entity) The command executor entity. | ||
| Line 91: | Line 91: | ||
:::: Simulates killing a specified entity with a specified tool. | :::: Simulates killing a specified entity with a specified tool. | ||
:::<code>loot <loot_table: string> ["<tool>|mainhand|offhand": string]</code> | :::<code>loot <loot_table: string> ["<tool>|mainhand|offhand": string]</code> | ||
:::: Invokes a | :::: Invokes a loot table with a specified tool. | ||
:::<code>mine <TargetBlockPosition: x y z> ["<tool>|mainhand|offhand": string]</code> | :::<code>mine <TargetBlockPosition: x y z> ["<tool>|mainhand|offhand": string]</code> | ||
:::: Simulates mining the block at the designated position with a specified tool. | :::: Simulates mining the block at the designated position with a specified tool. | ||
| Line 219: | Line 219: | ||
{{Navbox commands}} | {{Navbox commands}} | ||
de:Befehl/loot | |||
es:Comandos/loot | |||
ja:コマンド/loot | |||
ko:명령어/loot | |||
pt:Comandos/loot | |||
ru:Команды консоли/loot | |||
uk:Команди консолі/loot | |||
zh:命令/loot | |||
Revision as of 15:44, 9 April 2026
Drops the given 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 fishing with a specified tool at a specified position.
loot <loot_table>- Invokes a 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.
- Loot context provided by each
<SOURCE>is:
- Loot context provided by each
<SOURCE> Supplied loot context parameters fish - Template:Cd entity: (If the executor is an entity) The command executor entity.
- Origin: The center of the block at the specified position.
- Tool: The specified item.
kill - Template:Cd entity: The specified entity.
- Origin: The command execution position.
- Damage source: The
magicdamage type - Template:Cd entity: (If the executor is an entity) The command executor entity.
- Template:Cd entity: (If the executor is an entity) The command executor entity.
- Template:Cd entity: (If the executor is a player) The command executor player.
loot - Template:Cd entity: (If the executor is an entity) The command executor entity.
- Origin: The command execution position.
mine - Template:Cd entity: (If the executor is an entity) The command executor entity.
- Origin: The center of the block at the specified position.
- Tool: The specified item.
- Block state: The specified block.
- Block entity: (If the block is a block entity.) Block entity data of the block.
- 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 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
mainhandandoffhand, otherwise it represents an item id.
Template:Argument (in kill source)
- Specifies one entity to kill simulatively.
- Template:Arg desc
- 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
- Specifies one or more entities to modify.
- Template:Arg desc
- 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
Bedrock Edition
See also
- Template:Cmd — give specific items to players without specifying a loot table
- Template:CmdTemplate:Only — modify specific item slots of entities or container
- Template:CmdTemplate:Only — modify specific item slots of entities or container
External links
de:Befehl/loot es:Comandos/loot ja:コマンド/loot ko:명령어/loot pt:Comandos/loot ru:Команды консоли/loot uk:Команди консолі/loot zh:命令/loot