How To Use Item Ids In Minecraft
This article is a work in progress.
Please help in the expansion or cosmos of this article by expanding or improving it. The talk folio may contain suggestions.
Note: Add examples for /detail change
Manipulate or re-create items in the inventories of blocks (breast, furnaces, etc.) or entities (players or mobs).
Syntax [ ]
-
particular modify (block <pos>|entity <targets>) <slot> <modifier>- Modifies the items in the specified slot with the specified modifier.
-
particular replace (block <pos>|entity <targets>) <slot> with <item> [<count>]- Replaces the items in the specified slot with the specified items.
-
item supercede (cake <pos>|entity <targets>) <slot> from (block <sourcePos>|entity <sourceTarget>) <sourceSlot> [<modifier>]- Copies the source items to the target slot and optionally modifies it with the
modifier.
- Copies the source items to the target slot and optionally modifies it with the
Syntax displayed in various ways
-
Simplified tree: -
detail ...-
... modify <TARGET> <slot> <modifier> -
... replace <TARGET> <slot>-
... with <particular> [<count>] -
... from <SOURCE> <sourceSlot> [<modifier>]
-
-
- where substituted arguments are:
-
<TARGET>=(block <pos>|entity <targets>) -
<SOURCE>=(block <sourcePos>|entity <sourceTarget>)
-
-
-
Minimised: -
/item (modify (block <pos>|entity <targets>) <slot> <modifier>|supercede (cake <pos>|entity <targets>) <slot> (with <item> [<count>]|from (block <sourcePos>|entity <sourceTarget>) <sourceSlot> [<modifier>]))
-
-
Maximised: -
item modify block <pos> <slot> <modifier> -
item modify entity <targets> <slot> <modifier> -
detail replace block <pos> <slot> with <item> [<count>] -
item supplant block <pos> <slot> from block <sourcePos> <sourceSlot> [<modifier>] -
item supersede block <pos> <slot> from entity <sourceTarget> <sourceSlot> [<modifier>] -
item supplant entity <targets> <slot> with <item> [<count>] -
item replace entity <targets> <slot> from block <sourcePos> <sourceSlot> [<modifier>] -
detail replace entity <targets> <slot> from entity <sourceTarget> <sourceSlot> [<modifier>]
-
Arguments [ ]
<pos>: block_pos
- Specifies the position of the block to be modified.
- Information technology must be a block position equanimous of <x>, <y> and <z>, each of which must be an integer or a tilde and caret notation.
<targets>: entity
- Specifies one or more entities to modify.
- Must be a player name, a target selector or a UUID.
<slot>: item_slot
- Specifies the inventory slot to be modified. Valid values depend on whether a block or an entity is beingness modified.
- Must be a string annotation that refer to certain slots in the inventory, which consists of "slot type" and optional "slot number", in the format of
<slot_type>or<slot_type>.<slot_number>. Run across Slot for details.
<modifier>: resource_location
- Specifies the item modifier to apply on the chosen item.
- Must be a resources location.
<item>: item_stack
- Specifies the detail to be placed in the block or entity's inventory slot.
- It must be in course of
item_id{data_tags}(accepts item and block tags), in which data tags tin can be omitted when they are non needed.
<count>: integer
- Specifies the number of items to be placed in the block or entity's inventory slot.
- Must be a 32-fleck integer number. And it must be between i and 64 (inclusive).
<sourcePos>: block_pos
- Specifies the position of the block to copy items from.
- Information technology must be a block position composed of <ten>, <y> and <z>, each of which must exist an integer or a tilde and caret annotation.
<sourceTarget>: entity
- Specifies an entity to re-create items from.
- Must be a player name, a target selector or a UUID.
<sourceSlot>: item_slot
- Specifies the inventory slot to copy the items from. Valid values depend on whether the source is cake or an entity. Run across
<slot>argument to a higher place for more than information.
Result [ ]
| Command | Trigger | Java Edition |
|---|---|---|
| whatever | the arguments are non specified correctly | Unparseable |
/item modify ... | the specified <modifier> doesn't be | Failed |
/item change block ... | <pos> is unloaded or out of the world | |
the block at the <pos> is not a container | ||
the block at the <pos> does not accept the specified slot | ||
/item change entity ... | <targets> fails to resolve to one or more than entities (named actor must be online) | |
All selected entities meet 1 or more of the post-obit conditions:
| ||
/... with <item> <count> | <count> exceeds the stack limit of the specified item | |
/... from block ... | <sourcePos> is unloaded or out of the world | |
the cake at <sourcePos> is not a container | ||
the block at <sourcePos> does not have the specified slot | ||
/... from entity ... | <sourceTarget> fails to resolve to a single entity (named player must be online) | |
the <sourceTarget> doesn't have the specified slot (for example, zombies have no equus caballus.armor) | ||
| whatsoever | On success | Manipulate items in the specified slot. |
Output [ ]
| Command | Edition | State of affairs | Success Count | /execute store success ... | /execute shop outcome ... |
|---|---|---|---|---|---|
| any | Java Edition | On fail | 0 | 0 | 0 |
/item (modify|replace) block ... | On success | one | one | 1 | |
/item (alter|replace) entity ... | On success | 1 | 1 | the number of entities whose items are successfully replaced |
Examples [ ]
- To supercede the items in the bottom-correct slot of a single chest 2 block above with 4 spruce saplings:
-
/detail supersede cake ~ ~2 ~ container.26 with minecraft:spruce_sapling iv
-
- To replace the items in the rightmost hotbar slot of the nearest player with four spruce saplings:
-
/detail replace entity @p hotbar.eight with minecraft:spruce_sapling 4
-
- To supervene upon the detail in the offhand of the selected player with the detail in their primary hand:
-
/detail replace entity @due south weapon.offhand from entity @s weapon.mainhand
-
- To put a brown banner on a player's head
-
/particular replace entity @south armor.head with minecraft:brown_banner
-
- To increase the count of the item in your main hand:
-
/item modify entity @s weapon.mainhand case:increase_count - file in a datapack:
data/example/item_modifiers/increase_count.json{ "function" : "minecraft:set_count" , "count" : 1 , "add" : true }
-
History [ ]
| Java Edition | |||||
|---|---|---|---|---|---|
| 1.17 | 20w46a | Added /item, replacing /replaceitem. | |||
| 21w19a | Syntax of /particular has been inverse. | ||||
Run into also [ ]
-
/data— can also replace items in a container'south or mob's inventory, or modify the drop chances of armor and weapons -
/give— give items to players without specifying specific inventory slots or overwriting other items -
/replaceitem— The Bedrock Edition equivalent
How To Use Item Ids In Minecraft,
Source: https://minecraft.fandom.com/wiki/Commands/item
Posted by: haltertrachattee1941.blogspot.com

0 Response to "How To Use Item Ids In Minecraft"
Post a Comment