/clear Command in Minecraft Bedrock Edition

Clear Items From Player Inventory in Bedrock

Bedrock EditionItems & InventoryPermission: Game DirectorsCheats: YesJava version →

The /clear command in Minecraft Bedrock Edition removes items from a player's inventory. You can use it to wipe an entire inventory clean or remove a specific number of a single item.

Players and server operators use this command to clean up cluttered inventories in creative mode, reset players before a minigame starts, or take away specific items as part of an adventure map.

Syntax (1 form)

  1. /clear [player: target] [itemName: Item] [data: int] [maxCount: int]

    Clear

Arguments

ArgumentTypeWhat it means
dataintThe `item id` to be cleared. If not specified, all will be cleared. Default: `-1`.
itemNameItemThe item to clear. Clears all items if no specified. Item`ID`or block id.
maxCountintAn `integer` that specifies how many items to clear. Default: `-1`.
playertargetPlayer selector. May be a player name `string` or a selected target of type player.

Examples

Tips

Common mistakes

Bedrock vs Java

In Minecraft Java Edition, the syntax is /clear [<targets>] [<item>] [<maxCount>], which skips the separate data integer argument required between the item name and the maximum count in Bedrock Edition.

See /clear in Java Edition →

FAQ

How do I clear only one specific item from a player?

Specify the player, the item name, a data value like -1, and set the maxCount argument at the very end to 1.

What does the -1 mean in the Bedrock /clear command?

The number -1 is the default value for both the data and maxCount arguments, telling the game to match all data values or remove all matching items without a limit.

Why is the /clear command not working in my world?

The command requires cheats to be turned on and you must have the Game Directors permission level to run it.

Related commands

/enchant/give/loot/recipe/replaceitem