Minecraft /clear command
Java EditionBedrock EditionSince 1.4.2
Quick answer: Removes items from inventories. Syntax:
/clear [target] [item] [maxCount]/clear deletes matching items from a player's inventory. With no item specified it wipes the whole inventory; with an item and maxCount it removes only that many.
Syntax
| Edition | Syntax |
|---|---|
| Java | /clear [target] [item] [maxCount] |
| Bedrock | /clear [player: target] [itemName: Item] [data: int] [maxCount: int] |
Targets / arguments: players. Requires: Cheats enabled / operator level 2.
Examples
/clear @sEmpty your entire inventory
/clear @p minecraft:dirt 64Take up to 64 dirt from the nearest player
/clear Steve minecraft:netherite_swordRemove every netherite sword Steve holds
Tips
- Great for adventure maps: test whether a player has an item by running /clear with maxCount 0 - it succeeds without deleting anything (Java).
- Bedrock data values let you target specific potion or tool variants.