All commands
๐Ÿงน
UtilityJava โœ“Bedrock โœ“

/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

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'.

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

Related commands