/clear
Wipe items from a player's inventory - all of them, or just one.
Overview
What is the /clear command?
The /clear command removes items from a player's inventory. With no item it empties everything; name an item to remove just that one, and add a count to remove only part of a stack.
It's essential for minigame resets, taking back kit items, or cleaning up after a creative session.
When to use it: Use /clear to empty an inventory, confiscate a specific item, or reset players between minigame rounds.
At a glance
Syntax
/clear [target] [item] [count]See it
What it does
Anatomy
Every part, explained
- 1
CommandRequired/clearRemoves items from an inventory.
- 2
TargetOptional[target]Whose inventory. Defaults to you.
- 3
ItemOptional[item]Limit it to one item id. Omit to clear all.
- 4
CountOptional[count]How many to remove. Omit to remove every match.
Your turn
Try it yourself
Copy & paste
Examples
/clearEmpty your whole inventory.
/clear @s dirtRemove just the dirt.
/clear @aClear everyone's inventory.
Avoid these
Common mistakes
/clear @s diamond 0/clear @s diamondCount 0 only counts items - it removes nothing.
/clear @s dirts/clear @s dirtItem ids are singular - 'dirt', not 'dirts'.
Good to know
Frequently asked questions
- How do you clear your inventory with a command?
- Run /clear to empty your own inventory, or /clear <player> to empty someone else's.
- How do you remove just one item type?
- Use /clear @s <item> [count], e.g. /clear @s dirt 32 removes up to 32 dirt and leaves everything else.
- Can you check if a player has an item without removing it?
- Yes โ /clear with a count of 0 (e.g. /clear @s diamond 0) reports how many they have without taking any.
Keep going