COMMAND BUILDER
Minecraft /clear Generator.
Clears items from player inventories. Adjust settings below to instantly generate the correct syntax.
LIVE TERMINAL OUTPUT
Generated Minecraft Syntax
Copy and paste this output directly into your Minecraft game console (press T) or command blocks.
/give @s diamond 64
What this command does?
Removes items from the inventory of yourself (`@s`).
Documentation & Guide
About the /clear Generator
The /clear generator constructs commands to remove specific items, stacks, or entire inventories from players.
How to Use This Generator
- Select the target player selector.
- Optionally specify the item ID to delete (e.g. minecraft:dirt).
- Optionally set the maximum count to remove (leave empty to remove all).
- Copy and run in chat or command block.
Parameters & Options Explained
Target
The player whose inventory will be cleaned.
Item ID
Specific item to target; leaving blank clears the entire inventory.
Max Count
Number of items to delete. Setting count to 0 queries item presence without deleting.
Practical In-Game Example
Tested & Validated/clear @p minecraft:rotten_fleshRemoves all rotten flesh from the nearest player while keeping other items intact.
Java vs Bedrock Compatibility
Java Edition:Syntax: /clear <targets> [<item>] [<maxCount>]
Bedrock Edition:Syntax: /clear <player> [itemName] [data] [maxCount]
Important Limitations & Rules
- Running /clear with no arguments empties the entire inventory including armor and offhand.
- Cannot target offline players.