Commands/item

Manipulate or copy items in the inventories of blocks (chest, furnaces, etc.) or entities (players or mobs).

Syntax

 * Modifies the items in the specified slot with the specified modifier.
 * Replaces the items in the specified slot with the specified items.
 * Copies the source items to the target slot and optionally modifies it with the.
 * Replaces the items in the specified slot with the specified items.
 * Copies the source items to the target slot and optionally modifies it with the.
 * Copies the source items to the target slot and optionally modifies it with the.

Syntax displayed in various ways
 * {| class="collapsible collapsed collapse-button-none" data-description="simple_tree"

! style="text-align:left" | Simplified tree:
 * where substituted arguments are:
 * where substituted arguments are:
 * where substituted arguments are:
 * where substituted arguments are:
 * where substituted arguments are:
 * where substituted arguments are:
 * where substituted arguments are:
 * where substituted arguments are:


 * }
 * {| class="collapsible collapsed collapse-button-none" data-description="one_line"

! style="text-align:left" | Minimised:


 * }
 * {| class="collapsible collapsed collapse-button-none" data-description="maximised_tree"

! style="text-align:left" | Maximised:


 * }

Arguments

 * Specifies the position of the block to be modified.


 * Specifies one or more entities to modify.


 * Specifies the inventory slot to be modified. Valid values depend on whether a block or an entity is being modified.


 * Specifies the item modifier to apply on the chosen item.


 * Specifies the item to be placed in the block or entity's inventory slot.


 * Specifies the number of items to be placed in the block or entity's inventory slot.


 * Specifies the position of the block to copy items from.


 * Specifies an entity to copy items from.


 * Specifies the inventory slot to copy the items from. Valid values depend on whether the source is block or an entity. See  argument above for more information.

Examples

 * To replace the items in the bottom-right slot of a single chest two block above with four spruce saplings:
 * To replace the items in the rightmost hotbar slot of the nearest player with four spruce saplings:
 * To replace the item in the offhand of the selected player with the item in their main hand:
 * To put a brown banner on a player's head
 * To increase the count of the item in your main hand:
 * file in a datapack:
 * To put a brown banner on a player's head
 * To increase the count of the item in your main hand:
 * file in a datapack:
 * file in a datapack:
 * file in a datapack: