All commands
🧹
Utility

/clear

Wipe items from a player's inventory — all of them, or just one.

Try in Simulator

At a glance

Syntax

Syntax
/clear [target] [item] [count]
commandtargetcoordsvaluerequiredoptional

See it

What it does

💎
🍖
🪓
🧱
🏹
🌾
The inventory is cleared out

Anatomy

Every part, explained

  1. 1
    /clearCommandRequired

    Removes items from an inventory.

  2. 2
    [target]TargetOptional

    Whose inventory. Defaults to you.

  3. 3
    [item]ItemOptional

    Limit it to one item id. Omit to clear all.

  4. 4
    [count]CountOptional

    How many to remove. Omit to remove every match.

Your turn

Try it yourself

Playground
Tab
1 token · press Enter to run

Copy & paste

Examples

/clear

Empty your whole inventory.

/clear @s dirt

Remove just the dirt.

/clear @a

Clear everyone's inventory.

Avoid these

Common mistakes

/clear @s diamond 0
/clear @s diamond

Count 0 only counts items — it removes nothing.

/clear @s dirts
/clear @s dirt

Item ids are singular — 'dirt', not 'dirts'.

Keep going

Related commands