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

>/clear @p

Paste it into the Minecraft chat (the T key) or a command block

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.

10% off with promo code

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.

PROMO10
Copy
View plans