Items
/clear
Remove items from a player's inventory.
Syntax
Parameters
- targetsoptional
- entity selector
- Players to clear from. Defaults to executor.
- itemoptional
- item ID
- Specific item to remove. Omit to clear everything.
- countoptional
- integer
- Max count to remove. Default removes all matches.
Command builder
Configure the options below to generate a ready-to-paste /clear command.
Off = clears the entire inventory.
/clear @pExamples
Empty the nearest player's inventory.
Remove all dirt from every player.
Take exactly one diamond from the nearest player.
Permission level
/clear requires Cheats (op level 2). In single-player you need the world's "Allow Cheats" toggle on. On a multiplayer server you need to be opped — see /op.