News
Game
Guides
Downloads
Versions
/item
COMMANDS ITEMS & INVENTORY CHEATS · LEVEL 2 4 SUBCOMMANDS Added in 1.17

/item command in Minecraft

/item changes the items in specific slots of a container block or an entity: a chest, a player's hotbar, a zombie's helmet. It can place a new item, copy items from other slots, or run an item modifier on the item already there.

Syntax

/item fill (block|entity)
/item modify (block|entity)
/item override (block|entity)
/item replace (block|entity)
All 38 forms
  • /item fill block <target> <slots> from block <source> <sourceSlots>
  • /item fill block <target> <slots> from block <source> <sourceSlots> <modifier>
  • /item fill block <target> <slots> from entity <source> <sourceSlots>
  • /item fill block <target> <slots> from entity <source> <sourceSlots> <modifier>
  • /item fill block <target> <slots> with <item>
  • /item fill block <target> <slots> with <item> <count>
  • /item fill entity <target> <slots> from block <source> <sourceSlots>
  • /item fill entity <target> <slots> from block <source> <sourceSlots> <modifier>
  • /item fill entity <target> <slots> from entity <source> <sourceSlots>
  • /item fill entity <target> <slots> from entity <source> <sourceSlots> <modifier>
  • /item fill entity <target> <slots> with <item>
  • /item fill entity <target> <slots> with <item> <count>
  • /item modify block <target> <slots> <modifier>
  • /item modify entity <target> <slots> <modifier>
  • /item override block <target> <slots> from block <source> <sourceSlots>
  • /item override block <target> <slots> from block <source> <sourceSlots> <modifier>
  • /item override block <target> <slots> from entity <source> <sourceSlots>
  • /item override block <target> <slots> from entity <source> <sourceSlots> <modifier>
  • /item override block <target> <slots> with <item>
  • /item override block <target> <slots> with <item> <count>
  • /item override entity <target> <slots> from block <source> <sourceSlots>
  • /item override entity <target> <slots> from block <source> <sourceSlots> <modifier>
  • /item override entity <target> <slots> from entity <source> <sourceSlots>
  • /item override entity <target> <slots> from entity <source> <sourceSlots> <modifier>
  • /item override entity <target> <slots> with <item>
  • /item override entity <target> <slots> with <item> <count>
  • /item replace block <target> <slots> from block <source> <sourceSlots>
  • /item replace block <target> <slots> from block <source> <sourceSlots> <modifier>
  • /item replace block <target> <slots> from entity <source> <sourceSlots>
  • /item replace block <target> <slots> from entity <source> <sourceSlots> <modifier>
  • /item replace block <target> <slots> with <item>
  • /item replace block <target> <slots> with <item> <count>
  • /item replace entity <target> <slots> from block <source> <sourceSlots>
  • /item replace entity <target> <slots> from block <source> <sourceSlots> <modifier>
  • /item replace entity <target> <slots> from entity <source> <sourceSlots>
  • /item replace entity <target> <slots> from entity <source> <sourceSlots> <modifier>
  • /item replace entity <target> <slots> with <item>
  • /item replace entity <target> <slots> with <item> <count>
/item fillAdded in 26.3
/item fill (block|entity)
ArgumentExpectsWhat it does
targetBlock coordinates (x y z)The block to edit, as x y z coordinates of a container, or the entities to edit after entity, such as @s.
slotsSlotsDestination slots: weapon.mainhand, armor.head, hotbar.0, container.5, or several at once with container.*.
sourceBlock coordinates (x y z)Where to copy from: block coordinates of a container, or an entity selector, which may match several entities.
sourceSlotsSlotsSlots read on the source, written like the destination slots, for example weapon.mainhand or container.*.
modifieroptionalItem modifierItem modifier to apply: an ID from a data pack, or an inline definition in braces.
itemItem with componentsItem to place, with optional components, for example minecraft:diamond_sword[unbreakable={}].
countoptionalWhole number1 to 99Number of items placed in each slot, from 1 to 99. Defaults to 1.
All 12 forms
  • /item fill block <target> <slots> from block <source> <sourceSlots>
  • /item fill block <target> <slots> from block <source> <sourceSlots> <modifier>
  • /item fill block <target> <slots> from entity <source> <sourceSlots>
  • /item fill block <target> <slots> from entity <source> <sourceSlots> <modifier>
  • /item fill block <target> <slots> with <item>
  • /item fill block <target> <slots> with <item> <count>
  • /item fill entity <target> <slots> from block <source> <sourceSlots>
  • /item fill entity <target> <slots> from block <source> <sourceSlots> <modifier>
  • /item fill entity <target> <slots> from entity <source> <sourceSlots>
  • /item fill entity <target> <slots> from entity <source> <sourceSlots> <modifier>
  • /item fill entity <target> <slots> with <item>
  • /item fill entity <target> <slots> with <item> <count>
/item modify
/item modify (block|entity)
ArgumentExpectsWhat it does
targetBlock coordinates (x y z)The block to edit, as x y z coordinates of a container, or the entities to edit after entity, such as @s.
slotsSlotsDestination slots: weapon.mainhand, armor.head, hotbar.0, container.5, or several at once with container.*.
modifierItem modifierItem modifier applied to the items already in the slots: a data pack ID, or an inline definition.
All 2 forms
  • /item modify block <target> <slots> <modifier>
  • /item modify entity <target> <slots> <modifier>
/item overrideAdded in 26.3
/item override (block|entity)
ArgumentExpectsWhat it does
targetBlock coordinates (x y z)The block to edit, as x y z coordinates of a container, or the entities to edit after entity, such as @s.
slotsSlotsDestination slots: weapon.mainhand, armor.head, hotbar.0, container.5, or several at once with container.*.
sourceBlock coordinates (x y z)Where to copy from: block coordinates of a container, or an entity selector, which may match several entities.
sourceSlotsSlotsSlots read on the source, written like the destination slots, for example weapon.mainhand or container.*.
modifieroptionalItem modifierItem modifier to apply: an ID from a data pack, or an inline definition in braces.
itemItem with componentsItem to place, with optional components, for example minecraft:diamond_sword[unbreakable={}].
countoptionalWhole number1 to 99Number of items placed in each slot, from 1 to 99. Defaults to 1.
All 12 forms
  • /item override block <target> <slots> from block <source> <sourceSlots>
  • /item override block <target> <slots> from block <source> <sourceSlots> <modifier>
  • /item override block <target> <slots> from entity <source> <sourceSlots>
  • /item override block <target> <slots> from entity <source> <sourceSlots> <modifier>
  • /item override block <target> <slots> with <item>
  • /item override block <target> <slots> with <item> <count>
  • /item override entity <target> <slots> from block <source> <sourceSlots>
  • /item override entity <target> <slots> from block <source> <sourceSlots> <modifier>
  • /item override entity <target> <slots> from entity <source> <sourceSlots>
  • /item override entity <target> <slots> from entity <source> <sourceSlots> <modifier>
  • /item override entity <target> <slots> with <item>
  • /item override entity <target> <slots> with <item> <count>
/item replace
/item replace (block|entity)
ArgumentExpectsWhat it does
targetBlock coordinates (x y z)The block to edit, as x y z coordinates of a container, or the entities to edit after entity, such as @s.
slotsSlotsDestination slots: weapon.mainhand, armor.head, hotbar.0, container.5, or several at once with container.*.
sourceBlock coordinates (x y z)Where to copy from: block coordinates of a container, or an entity selector, which may match several entities.
sourceSlotsSlotsSlots read on the source, written like the destination slots, for example weapon.mainhand or container.*.
modifieroptionalItem modifierItem modifier to apply: an ID from a data pack, or an inline definition in braces.
itemItem with componentsItem to place, with optional components, for example minecraft:diamond_sword[unbreakable={}].
countoptionalWhole number1 to 99Number of items placed in each slot, from 1 to 99. Defaults to 1.
All 12 forms
  • /item replace block <target> <slots> from block <source> <sourceSlots>
  • /item replace block <target> <slots> from block <source> <sourceSlots> <modifier>
  • /item replace block <target> <slots> from entity <source> <sourceSlots>
  • /item replace block <target> <slots> from entity <source> <sourceSlots> <modifier>
  • /item replace block <target> <slots> with <item>
  • /item replace block <target> <slots> with <item> <count>
  • /item replace entity <target> <slots> from block <source> <sourceSlots>
  • /item replace entity <target> <slots> from block <source> <sourceSlots> <modifier>
  • /item replace entity <target> <slots> from entity <source> <sourceSlots>
  • /item replace entity <target> <slots> from entity <source> <sourceSlots> <modifier>
  • /item replace entity <target> <slots> with <item>
  • /item replace entity <target> <slots> with <item> <count>

Examples

Wear a carved pumpkin

/item replace entity @s armor.head with minecraft:carved_pumpkin

Puts a Carved Pumpkin in your helmet slot, replacing what was there.

Java 26.3

Five diamonds in a chest

/item replace block ~ ~-1 ~ container.0 with minecraft:diamond 5

Sets the first slot of the container under you to five diamonds.

Java 26.3

Copy your main hand item

/item replace entity @s weapon.offhand from entity @s weapon.mainhand

Duplicates the item in your main hand into your off hand.

Java 26.3

Change a stack size inline

/item modify entity @s weapon.mainhand {function:"minecraft:set_count",count:10}

An inline item modifier sets the stack in your main hand to 10 items.

Java 26.3
Build your command

Fill in the fields, then copy the command.

Command generator

Slots and slot sources

Slots are written weapon.mainhand, weapon.offhand, armor.head, hotbar.0, container.5 or enderchest.0. A wildcard such as container.* selects several slots at once. Since 26.3, the slots argument takes a slot source, so data packs can also define their own slot selections.

replace, fill or override

The three share the same syntax. They differ when the destination has more slots than the source has items: replace copies items one by one and leaves the extra slots unchanged, fill repeats the source items until every slot is full, and override empties the leftover slots. With from entity, the selector may match several entities, and their slots are chained together.

Tips

The armor.head slot accepts any item, so a player can wear a Carved Pumpkin or a block of Glass. A block target must be a container, such as a Chest, otherwise the game answers "Target position 0, 64, 0 is not a container". modify applies an item modifier from a data pack, or one written inline. For a new item in a free slot, /give is simpler; for random loot, use /loot.

✓ Checked in Java Edition 26.3 · updated 2 November 2026

/item: FAQ

How do I put a block on a player's head?

Use /item replace entity @s armor.head with the block ID, for example minecraft:glass. Any item fits in that slot.

What is the difference between /item replace and /item override?

Both copy the source items into the slots in order. When there are fewer items than slots, replace leaves the extra slots as they were, while override empties them.

How do I use /item?

Type it in the chat with cheats on: /item fill (block|entity).

Who can use /item?

Cheats on, or operator level 2.

Since when does /item exist?

It is in the official command tree since Java Edition 1.17.

Related commands