How to clear the inventory — the /clear command
Generator /clear
Clear a player's inventory — adjust the parameters and copy the finished result
The /clear command removes items from a player’s inventory. Without parameters it clears the whole inventory; with an item specified — only that item.
Clear from whom
The nearest player to the point where the command runs
Item (optional)
Leave empty to clear everything
Quantity (optional)
-1 = remove all. 0 = check presence without removing
Generated command
Paste it into the Minecraft chat (the T key) or a command block
Other commands
/give
Give an item to a player
/summon
Summon a mob or entity
/effect
Apply an effect to a player
/enchant
Enchant the item in hand
/gamemode
Change game mode
/tp
Teleport a player
/time
Change the time of day
/weather
Change the weather
/xp
Give experience to a player
/difficulty
Change world difficulty
/gamerule
Change world rules
/setblock
Place a block at coordinates
/fill
Fill an area with blocks
/spawnpoint
Set the spawn point
How does /clear work?
The /clear command removes items from a player’s inventory. Syntax: /clear <player> [item] [quantity]. Without arguments it removes all items. With an item specified — only that one. With a quantity — exactly that many.
Partial clearing
You can remove a specific item: /clear @s minecraft:diamond 10 — removes 10 diamonds from your inventory. If there are fewer than 10 diamonds — it removes all that are present. A quantity of 0 — checks for presence without removing.
Full clearing
/clear @s without additional parameters removes absolutely all items from the inventory, including armor, off-hand items and hotbar contents. Be careful!
Use on servers
The /clear command is useful on servers to reset inventories before mini-games, when banning with item confiscation, or for creating “shop” systems via command blocks.
Looking for Minecraft server hosting?
Launch your server in a minute — one-click mod and plugin installation, DDoS protection, powerful hardware. Promo code PROMO10 gives 10% off any plan.
