# The /item command in Minecraft: put a block on your head, fill chests and change items

> How to use /item in Minecraft Java: put a block on your head, dress up mobs, fill a chest, copy another player's item and what's new in 26.3.

Original page: https://napnodes.com/en/guides/minecraft-item-command · Updated: 2026-11-08

/item puts an item into a specific slot: a player's head, a zombie's hand, the third slot of a chest. It's the command people use to wear glass or a pumpkin as a hat, the one that dresses up the mobs in a map and the one that fills an event's chests without opening them one by one. Here's the form today's Java version uses, which gained two new modes in 26.3.

## How it's written

The form used most is `/item replace entity <who> <slot> with <item> <count>`. With `block` and some coordinates instead of `entity`, it goes into a chest, a barrel, a furnace or any block with an inventory.

You need to be an operator (level 2) or have cheats on in a single-player world. On a server, you op yourself from the console with `op YourName` ([the guide to giving op](https://napnodes.com/en/guides/op-player-minecraft-server)).

The item is written the same way as in /give, with its ID and its components in square brackets if it has any; the count is optional, from 1 to 99. If you don't know the ID, look it up in the [Minecraft item ID list](https://napnodes.com/en/tools/minecraft-item-ids).

Unlike /give, /item doesn't look for a free slot: it puts the item exactly where you say and whatever was there disappears. That's why it works for the head, which /give never fills.

## The slots used most

1. **Armour**: `armor.head`, `armor.chest`, `armor.legs` and `armor.feet`: head, chest, legs and feet. On horses and wolves, the armour goes in `armor.body`.
2. **Hands**: `weapon.mainhand` is the main hand (whatever you have selected) and `weapon.offhand`, the off hand.
3. **Hotbar and inventory**: `hotbar.0` to `hotbar.8`, from left to right, and `inventory.0` to `inventory.26` for the three rows above.
4. **Ender chest**: `enderchest.0` to `enderchest.26`: a player's ender chest, even if they don't have it open.
5. **Blocks**: `container.0` onwards. In a normal chest, from 0 to 26, starting at the top left; in a furnace, `container.0` is what's cooking, `container.1` the fuel and `container.2` the result.

## Putting a block on your head

It's what people search for most with /item: `/item replace entity @s armor.head with minecraft:glass` gives you a glass block as a helmet. Any block or item works: `minecraft:carved_pumpkin`, `minecraft:tnt`, `minecraft:oak_leaves`… Blocks show on the head at full size.

A player head too: `/item replace entity @s armor.head with minecraft:player_head[profile="Notch"]` in today's version. For textured heads or mob heads, the [player head generator](https://napnodes.com/en/tools/minecraft-player-head-generator).

To give it to someone else, change `@s` for their name; for everyone, `@a`. Watch out: whatever they had on their head disappears, it doesn't go back to the inventory.

## Dressing up mobs and armor stands

1. **A zombie with a sword**: `/item replace entity @e[type=minecraft:zombie,limit=1,sort=nearest] weapon.mainhand with minecraft:diamond_sword` gives the nearest zombie a diamond sword.
2. **Every skeleton nearby with a helmet**: `/item replace entity @e[type=minecraft:skeleton,distance=..20] armor.head with minecraft:iron_helmet`: that way they don't burn in the sun. The options in square brackets are in [the selectors guide](https://napnodes.com/en/guides/minecraft-target-selectors).
3. **An armor stand as a mannequin**: `/item replace entity @e[type=minecraft:armor_stand,limit=1,sort=nearest] armor.chest with minecraft:diamond_chestplate`. To create it with a pose, arms and everything already on, the [armor stand generator](https://napnodes.com/en/tools/minecraft-armor-stand-generator).
4. **Armour for a wolf**: `/item replace entity @e[type=minecraft:wolf,limit=1,sort=nearest] armor.body with minecraft:wolf_armor`.

## Filling chests without opening them

Look at the chest and press F3 to see its coordinates. Then `/item replace block 100 64 -200 container.0 with minecraft:diamond 64` puts 64 diamonds in the first slot. That's how the chests for an event, a UHC or an adventure map get prepared.

Since 26.3, the slot can be several at once with `*`: `/item replace block 100 64 -200 container.* with minecraft:bread 16` puts 16 bread in every slot of the chest. Before 26.3, each command went to a single slot.

To empty a slot, put air: `/item replace block 100 64 -200 container.4 with minecraft:air`.

If the coordinates aren't a block with an inventory, the game answers «Target position 100, 64, -200 is not a container».

## Copying an item from somewhere else

With `from` instead of `with`, /item copies what's in another slot, without taking it from the source. `/item replace entity @s weapon.mainhand from entity Ana weapon.mainhand` gives you an exact copy of what Ana is holding, with its enchantments and its name.

It also works from a chest to a player: `/item replace entity @a hotbar.0 from block 100 64 -200 container.0` hands everyone whatever is in the first slot of that chest. That's how you set up a starter kit you can change without touching the commands: just change what's in the chest.

## New in 26.3: fill and override

Since 26.3, besides `replace` there are `fill` and `override`, written the same way. The difference is what happens when you copy from several slots to several slots.

1. **replace**: Fills the target slots in order with the source ones and, if there are slots left over, leaves them as they were.
2. **fill**: Repeats the source items until every target slot is full. `/item fill entity @s hotbar.* from entity @s hotbar.0` puts what's in your first slot into all nine of the hotbar.
3. **override**: Like replace, but the target slots left over are emptied. Handy for swapping a whole kit without leftovers from the previous one.

## Changing an item that already exists: /item modify

`modify` doesn't put a new item: it changes the one that's there with an item modifier, the same format as datapack loot tables. In today's version you can write it inside the command itself.

`/item modify entity @s weapon.mainhand {function:"minecraft:set_count",count:64}` sets what you're holding to 64, and `/item modify entity @s weapon.mainhand {function:"minecraft:set_damage",damage:1.0}` fully repairs the tool you're carrying.

For long modifiers or ones you'll reuse, it's better to save them in a datapack and call them by name ([the datapacks guide](https://napnodes.com/en/guides/minecraft-server-datapacks)).

## The usual errors

«The target does not have slot …»: that slot doesn't exist on that mob or block. A pig has no `hotbar.0` and a chest has no `armor.head`.

«No targets accepted item into slot …»: nothing can be put in that slot on what you picked. If instead it says no entity was found, the selector didn't pick anyone: check the type (with `minecraft:` in front) and that the mob is loaded.

A command from an old video with `/replaceitem`: that command was removed in 1.17 and this is its replacement. Change `replaceitem` to `item replace` and put `with` before the item.

To run it every so often or at the press of a button, use [command blocks](https://napnodes.com/en/guides/minecraft-server-command-blocks) or conditions with [/execute](https://napnodes.com/en/guides/minecraft-execute-command). And if what you want is to give something without overwriting what's there, that's /give: [its guide](https://napnodes.com/en/guides/minecraft-give-command).

## On NapNodes

Minecraft servers run Paper on the latest version, so everything in this guide applies, including `fill`, `override` and slots with `*`. From the panel's «Console» you run any /item without the slash; with `entity` and a player's name, they need to be online.

Before filling a map's chests in bulk on a paid server, make a backup in «Backups»: /item overwrites whatever was there and there's no undo. The free server has no backups, so there try it on a single chest first.

## Questions

### How do I put a block on my head in Minecraft?

With /item replace entity @s armor.head with and the block, for example /item replace entity @s armor.head with minecraft:glass. You need to be an operator or have cheats on.

### What's the difference between /item and /give?

/give puts the item in the first free slot of the inventory; /item puts it in the slot you say, including the head, a mob or a chest, and overwrites what was there.

### How do I fill a chest with commands?

With /item replace block, the chest's coordinates, the slot and the item: /item replace block 100 64 -200 container.0 with minecraft:diamond 64. Since 26.3, container.* fills every slot at once.

### What happened to /replaceitem?

It was removed in 1.17 and /item replace replaces it. The rest is written almost the same, with with before the item.

### What do /item fill and /item override do?

They're from 26.3. fill repeats the source items until every target slot is full; override copies them and empties the target slots left over.

### How do I copy the item another player is holding?

With from: /item replace entity @s weapon.mainhand from entity Ana weapon.mainhand gives you an exact copy of what Ana is holding, without taking it from her.

---

NapNodes gives you a free Minecraft server, no card and no end date: it isn't always on (it switches itself off after an hour with nobody on, and you start it again with one click). How it works: https://napnodes.com/en/free. Paid plans, always on and with no commitment: https://napnodes.com/en/pricing.
