Wear a carved pumpkin
/item replace entity @s armor.head with minecraft:carved_pumpkinPuts a Carved Pumpkin in your helmet slot, replacing what was there.

/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.
/item fill (block|entity)/item modify (block|entity)/item override (block|entity)/item replace (block|entity)/item fillAdded in 26.3/item fill (block|entity)| Argument | Expects | What it does |
|---|---|---|
| target | Block 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. |
| slots | Slots | Destination slots: weapon.mainhand, armor.head, hotbar.0, container.5, or several at once with container.*. |
| source | Block coordinates (x y z) | Where to copy from: block coordinates of a container, or an entity selector, which may match several entities. |
| sourceSlots | Slots | Slots read on the source, written like the destination slots, for example weapon.mainhand or container.*. |
| modifieroptional | Item modifier | Item modifier to apply: an ID from a data pack, or an inline definition in braces. |
| item | Item with components | Item to place, with optional components, for example minecraft:diamond_sword[unbreakable={}]. |
| countoptional | Whole number1 to 99 | Number of items placed in each slot, from 1 to 99. Defaults to 1. |
/item modify/item modify (block|entity)| Argument | Expects | What it does |
|---|---|---|
| target | Block 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. |
| slots | Slots | Destination slots: weapon.mainhand, armor.head, hotbar.0, container.5, or several at once with container.*. |
| modifier | Item modifier | Item modifier applied to the items already in the slots: a data pack ID, or an inline definition. |
/item overrideAdded in 26.3/item override (block|entity)| Argument | Expects | What it does |
|---|---|---|
| target | Block 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. |
| slots | Slots | Destination slots: weapon.mainhand, armor.head, hotbar.0, container.5, or several at once with container.*. |
| source | Block coordinates (x y z) | Where to copy from: block coordinates of a container, or an entity selector, which may match several entities. |
| sourceSlots | Slots | Slots read on the source, written like the destination slots, for example weapon.mainhand or container.*. |
| modifieroptional | Item modifier | Item modifier to apply: an ID from a data pack, or an inline definition in braces. |
| item | Item with components | Item to place, with optional components, for example minecraft:diamond_sword[unbreakable={}]. |
| countoptional | Whole number1 to 99 | Number of items placed in each slot, from 1 to 99. Defaults to 1. |
/item replace/item replace (block|entity)| Argument | Expects | What it does |
|---|---|---|
| target | Block 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. |
| slots | Slots | Destination slots: weapon.mainhand, armor.head, hotbar.0, container.5, or several at once with container.*. |
| source | Block coordinates (x y z) | Where to copy from: block coordinates of a container, or an entity selector, which may match several entities. |
| sourceSlots | Slots | Slots read on the source, written like the destination slots, for example weapon.mainhand or container.*. |
| modifieroptional | Item modifier | Item modifier to apply: an ID from a data pack, or an inline definition in braces. |
| item | Item with components | Item to place, with optional components, for example minecraft:diamond_sword[unbreakable={}]. |
| countoptional | Whole number1 to 99 | Number of items placed in each slot, from 1 to 99. Defaults to 1. |
/item replace entity @s armor.head with minecraft:carved_pumpkinPuts a Carved Pumpkin in your helmet slot, replacing what was there.
/item replace block ~ ~-1 ~ container.0 with minecraft:diamond 5Sets the first slot of the container under you to five diamonds.
/item replace entity @s weapon.offhand from entity @s weapon.mainhandDuplicates the item in your main hand into your off hand.
/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.
Fill in the fields, then copy the command.
Command generatorSlots 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.
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.
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
Use /item replace entity @s armor.head with the block ID, for example minecraft:glass. Any item fits in that slot.
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.
Type it in the chat with cheats on: /item fill (block|entity).
Cheats on, or operator level 2.
It is in the official command tree since Java Edition 1.17.