/item Command in Minecraft Java Edition

Edit Block and Entity Inventories with /item

Java EditionItems & InventoryPermission: Level 2Added in 1.17Bedrock version →

The /item command in Minecraft Java Edition lets you directly control what is inside the inventory slots of blocks and entities. You can place new items, copy items from one inventory to another, or apply item modifiers to existing slots.

Players and mapmakers use this command when they need to equip mobs, update chest contents, or change what a player is holding. It requires permission level 2, meaning you must be an operator or have cheats enabled in single-player.

Syntax (Java 26.3, 20 forms)

  1. /item fill block <target> <slots> from block <source> <sourceSlots> [<modifier>]
  2. /item fill block <target> <slots> from entity <source> <sourceSlots> [<modifier>]
  3. /item fill block <target> <slots> with <item> [<count>]
  4. /item fill entity <target> <slots> from block <source> <sourceSlots> [<modifier>]
  5. /item fill entity <target> <slots> from entity <source> <sourceSlots> [<modifier>]
  6. /item fill entity <target> <slots> with <item> [<count>]
  7. /item modify block <target> <slots> <modifier>
  8. /item modify entity <target> <slots> <modifier>
  9. /item override block <target> <slots> from block <source> <sourceSlots> [<modifier>]
  10. /item override block <target> <slots> from entity <source> <sourceSlots> [<modifier>]
  11. /item override block <target> <slots> with <item> [<count>]
  12. /item override entity <target> <slots> from block <source> <sourceSlots> [<modifier>]
  13. /item override entity <target> <slots> from entity <source> <sourceSlots> [<modifier>]
  14. /item override entity <target> <slots> with <item> [<count>]
  15. /item replace block <target> <slots> from block <source> <sourceSlots> [<modifier>]
  16. /item replace block <target> <slots> from entity <source> <sourceSlots> [<modifier>]
  17. /item replace block <target> <slots> with <item> [<count>]
  18. /item replace entity <target> <slots> from block <source> <sourceSlots> [<modifier>]
  19. /item replace entity <target> <slots> from entity <source> <sourceSlots> [<modifier>]
  20. /item replace entity <target> <slots> with <item> [<count>]

The forms you will use most

/item replace entity <target> <slots> with <item> [<count>]
Replaces the specified slots of an entity with a chosen item and optional stack count.
/item replace block <target> <slots> with <item> [<count>]
Replaces the specified slots of a block container at the given coordinates with a chosen item.
/item replace entity <target> <slots> from entity <source> <sourceSlots> [<modifier>]
Copies items from a source entity's slots into a target entity's slots, optionally applying a modifier.
/item fill block <target> <slots> with <item> [<count>]
Fills the specified slots of a block container with a specific item and amount.
/item fill entity <target> <slots> from block <source> <sourceSlots> [<modifier>]
Fills a target entity's slots using items taken from a block container's slots.
/item override entity <target> <slots> with <item> [<count>]
Overrides the target entity's specified slots with a new item and count.
/item modify entity <target> <slots> <modifier>
Applies an item modifier to the items currently inside a target entity's slots.
/item modify block <target> <slots> <modifier>
Applies an item modifier to the items currently inside a block container's slots.

Arguments

ArgumentTypeWhat it means
<target>block positionThree coordinates x y z. Use ~ for relative or ^ for local coordinates.
<slots>slot sourceA slot source indicating which inventory slots on the target will be changed.
<source>block positionThree coordinates x y z. Use ~ for relative or ^ for local coordinates.
<sourceSlots>slot sourceA slot source specifying which inventory slots on the source to read items from.
<modifier>item modifierAn item modifier ID or an inline modifier used to alter the item's properties.
<source>target selectorA player name, a UUID or a target selector such as @p, @a, @e or @s.
<item>itemAn item ID, optionally followed by item components in brackets such as diamond_sword[enchantments={sharpness:5}].
<count>whole number
1 to 99
A whole number from 1 to 99 setting the stack size of the item.
<target>target selectorA player name, a UUID or a target selector such as @p, @a, @e or @s.

Examples

Version history

Measured from the game files of every Java release from 1.13 to 26.3.

  1. 26.3 Syntax changed.
    + /item fill block <target> <slots> from block <source> <sourceSlots> [<modifier>]+ /item fill block <target> <slots> from entity <source> <sourceSlots> [<modifier>]+ /item fill block <target> <slots> with <item> [<count>]+ /item fill entity <target> <slots> from block <source> <sourceSlots> [<modifier>]+ /item fill entity <target> <slots> from entity <source> <sourceSlots> [<modifier>]+ /item fill entity <target> <slots> with <item> [<count>]− /item modify block <pos> <slot> <modifier>− /item modify entity <targets> <slot> <modifier>− /item replace block <pos> <slot> from block <source> <sourceSlot> [<modifier>]− /item replace block <pos> <slot> from entity <source> <sourceSlot> [<modifier>]− /item replace block <pos> <slot> with <item> [<count>]− /item replace entity <targets> <slot> from block <source> <sourceSlot> [<modifier>]and 16 more
  2. 1.17 Command added.

Tips

Common mistakes

Java vs Bedrock

In Minecraft Bedrock Edition, the /item command does not exist; instead, players use the /replaceitem command (for example, /replaceitem block <position: x y z> slot.container <slotId: int> <itemName: Item> or /replaceitem entity <target: target> <slotType: EntityEquipmentSlot> <slotId: int> <itemName: Item>).

See /replaceitem in Bedrock Edition →

FAQ

When was the /item command added to Minecraft Java Edition?

The /item command was added to Minecraft Java Edition in version 1.17.

What changed with the /item command in version 26.3?

In version 26.3, the syntax was updated to add /item fill and /item override forms, and arguments were updated to use slot sources like <slots> and <sourceSlots>.

What permission level do I need to use /item?

You need permission level 2, which means you must be a server operator or have cheats turned on in a single-player world.

Related commands

/clear/enchant/give/loot/recipe