Free browser tool

Minecraft Clear Command Generator

Build a Java Edition /clear command: remove an item from a player inventory, or count it without removing by setting the amount to 0.

Item catalog: Java Edition 26.2 · 1,538 items

Build Your /clear Command

Generated command /clear @p

How the /clear Command Works

The syntax is /clear <target> [item] [maxCount]. With no item it wipes the whole inventory. With an item but no amount it removes all of that item. Amount 0 is special: it removes nothing and instead reports how many of the item the player has — the standard way to check inventories.

Examples

/clear @p minecraft:diamond

Remove every diamond from the nearest player.

/clear @p minecraft:diamond 0

Count the nearest player's diamonds without removing them.

/clear @a[team=red] minecraft:tnt 5

Remove up to 5 TNT from every red-team player.

Minecraft Clear Command Generator FAQ

How do I check whether a player has an item?

Run /clear <target> <item> 0. It deletes nothing and the chat result tells you how many they hold.

Can /clear remove items from armor and offhand slots?

Yes. /clear checks every inventory slot, including armor, offhand, and crafting grids.

Does /clear work on chests?

No. /clear only affects players. To empty a chest, use /data, /item, or break and replace it.

Related Tools