This Minecraft tutorial explains how to use a game command to clear your inventory with screenshots and step-by-step instructions.

You are watching: How to clear the chat in minecraft

You can clear items from a player"s inventory using the /clear command in Minecraft. Let"s explore how to use this cheat (game command).

Supported Platforms

The /clear command is available in the following versions of Minecraft:

PlatformSupported (Version*)
*
Java Edition (PC/Mac)
Yes (1.4.2)
*
Pocket Edition (PE)
Yes (1.0.5)
*
Xbox 360
No
*
Xbox One
Yes (1.2)
*
PS3
No
*
PS4
Yes (1.14.0)
*
Wii U
No
*
Nintendo Switch
Yes (1.5.0)
*
Windows 10 Edition
Yes (1.0.5)
*
Education Edition
Yes (1.0.18)

* The version that it was added or removed, if applicable.NOTE: Pocket Edition (PE), Xbox One, PS4, Nintendo Switch, and Windows 10 Edition are now called Bedrock Edition. We will continue to show them individually for version history.

Requirements

To run game commands in Minecraft, you have to turn cheats on in your world.

Clear Command


JavaPEXboxPSNintendoWin10Edu

Clear Command in Minecraft Java Edition (PC/Mac)

In Minecraft Java Edition (PC/Mac) 1.13, 1.14, 1.15 and 1.16, the syntax to clear items from a player"s inventory is:

/clear In Minecraft Java Edition (PC/Mac) 1.8, 1.9, 1.10, 1.11 and 1.12, the syntax to clear items from a player"s inventory is:

/clear
DefinitionsmaxCount is optional. It is the maximum number of items that will be cleared. If you omit this parameter or use -1, all matching items will be cleared.

Clear Command in Minecraft Pocket Edition (PE)

In Minecraft Pocket Edition, the syntax to clear items from a player"s inventory is:

/clear
DefinitionsmaxCount is optional. It is the maximum number of items that will be cleared. If you omit this parameter or use -1, all matching items will be cleared.

Clear Command in Minecraft Xbox One Edition

In Minecraft Xbox One Edition, the syntax to clear items from a player"s inventory is:

/clear
DefinitionsmaxCount is optional. It is the maximum number of items that will be cleared. If you omit this parameter or use -1, all matching items will be cleared.

Clear Command in Minecraft PS4 Edition

In Minecraft PS4 Edition, the syntax to clear items from a player"s inventory is:

/clear
DefinitionsmaxCount is optional. It is the maximum number of items that will be cleared. If you omit this parameter or use -1, all matching items will be cleared.

Clear Command in Minecraft Nintendo Switch Edition

In Minecraft Nintendo Switch Edition, the syntax to clear items from a player"s inventory is:

/clear
DefinitionsmaxCount is optional. It is the maximum number of items that will be cleared. If you omit this parameter or use -1, all matching items will be cleared.

Clear Command in Minecraft Windows 10 Edition

In Minecraft Windows 10 Edition, the syntax to clear items from a player"s inventory is:

/clear
DefinitionsmaxCount is optional. It is the maximum number of items that will be cleared. If you omit this parameter or use -1, all matching items will be cleared.

Clear Command in Minecraft Education Edition

In Minecraft Education Edition, the syntax to clear items from a player"s inventory is:

/clear
DefinitionsmaxCount is optional. It is the maximum number of items that will be cleared. If you omit this parameter or use -1, all matching items will be cleared.

Examples


JavaPEXboxPSNintendoWin10Edu

Example in Java Edition (PC/Mac) 1.13, 1.14, 1.15 and 1.16

To remove all items from your inventory in Minecraft 1.13, 1.14, 1.15 and 1.16:

/clearTo clear carolannpeacock.com"s inventory:

/clear carolannpeacock.comTo clear diamond swords from all players" inventory:

/clear
a diamond_swordTo clear 2 diamond swords from all players" inventory:

/clear
a diamond_sword 2To remove all diamond swords that are enchanted with Sharpness (any level of this enchantment) from carolannpeacock.com"s inventory:

/clear carolannpeacock.com diamond_sword{ench:<{id:16}>}To remove all diamond swords that are enchanted with Sharpness V (only level 5 of this enchantment) from carolannpeacock.com"s inventory:

/clear carolannpeacock.com diamond_sword{ench:<{id:16,lvl:5}>}Examples that Check for Items in a Player"s InventoryFinally, you can use the /clear command to check if an item is in a player"s inventory. This is done by setting maxCount to 0 in the /clear command.

To check the number of TNT that carolannpeacock.com has in inventory:

/clear carolannpeacock.com tnt 0To check the number of enchanted diamond swords (Sharpness V) each player has in their inventory:

/clear
a diamond_sword{ench:<{id:16,lvl:5}>} 0

Example in Java Edition (PC/Mac) 1.11 and 1.12

To remove all items from your inventory in Minecraft 1.11 and 1.12:

/clearTo clear TNT from all players" inventory:

/clear
a tntTo clear 10 TNT from all players" inventory:

/clear
a tnt 0 10To clear red carpet from all players" inventory:

/clear
a carpet 14To remove all fishing rods that are enchanted with Luck of the Sea (any level of this enchantment) from carolannpeacock.com"s inventory:

/clear carolannpeacock.com fishing_rod 0 -1 {ench:<{id:61}>}To remove all fishing rods that are enchanted with Luck of the Sea III (only level 3 of this enchantment) from carolannpeacock.com"s inventory:

/clear carolannpeacock.com fishing_rod 0 -1 {ench:<{id:61,lvl:3}>}Examples that Check for Items in a Player"s InventoryFinally, you can use the /clear command to check if an item is in a player"s inventory. This is done by setting maxCount to 0 in the /clear command.

To check the number of TNT that carolannpeacock.com has in inventory:

/clear carolannpeacock.com tnt 0 0To check the number of enchanted fishing rods (Luck of the Sea III) each player has in their inventory:

/clear
a fishing_rod 0 0 {ench:<{id:61,lvl:3}>}

Example in Pocket Edition (PE)

To remove all items from your inventory in Minecraft PE:

/clearTo clear carolannpeacock.com"s inventory:

/clear carolannpeacock.comTo clear iron trapdoors from all players" inventory:

/clear
a iron_trapdoorTo clear 4 iron trapdoors from all players" inventory:

/clear
a iron_trapdoor 0 4To clear cyan wool from the nearest player"s inventory:

/clear
p wool 9Examples that Check for Items in a Player"s InventoryFinally, you can use the /clear command to check if an item is in a player"s inventory. This is done by setting maxCount to 0 in the /clear command.

To check the number of diamond swords that carolannpeacock.com has in inventory:

/clear carolannpeacock.com diamond_sword 0 0

Example in Xbox One Edition

To remove all items from your inventory in Minecraft Xbox One Edition:

/clearTo clear TheExcavator"s inventory:

/clear TheExcavatorTo clear tridents from all players" inventory:

/clear
a tridentTo clear 1 trident from all players" inventory:

/clear
a trident 0 1To clear yellow dye from the nearest player"s inventory:

/clear
p dye 11Examples that Check for Items in a Player"s InventoryFinally, you can use the /clear command to check if an item is in a player"s inventory. This is done by setting maxCount to 0 in the /clear command.

To check the number of iron swords that carolannpeacock.com has in inventory:

/clear carolannpeacock.com iron_sword 0 0

Example in PS4 Edition

To remove all items from your inventory in Minecraft PS4 Edition:

/clearTo clear carolannpeacock.com"s inventory:

/clear carolannpeacock.comTo clear shields from all players" inventory:

/clear
a shieldTo clear 1 shield from all players" inventory:

/clear
a shield 0 1To clear red dye from the nearest player"s inventory:

/clear
p dye 1Examples that Check for Items in a Player"s InventoryFinally, you can use the /clear command to check if an item is in a player"s inventory. This is done by setting maxCount to 0 in the /clear command.

To check the number of golden apples that carolannpeacock.com has in inventory:

/clear carolannpeacock.com golden_apple 0 0

Example in Nintendo Switch Edition

To remove all items from your inventory in Minecraft Nintendo Switch Edition:

/clearTo clear TheEarthMover"s inventory:

/clear TheEarthMoverTo clear golden swords from all players" inventory:

/clear
a golden_swordTo clear 1 golden_sword from all players" inventory:

/clear
a golden_sword 0 1To clear birch planks from the nearest player"s inventory:

/clear
p planks 1 2Examples that Check for Items in a Player"s InventoryFinally, you can use the /clear command to check if an item is in a player"s inventory. This is done by setting maxCount to 0 in the /clear command.

To check the number of tridents that carolannpeacock.com has in inventory:

/clear carolannpeacock.com trident 0 0

Example in Windows 10 Edition

To remove all items from your inventory in Windows 10 Edition:

/clearTo clear Axe2Grind"s inventory:

/clear Axe2GrindTo clear levers from all players" inventory:

/clear
a leverTo clear 3 levers from all players" inventory:

/clear
a lever 0 3To clear magenta carpet from the nearest player"s inventory:

/clear
p carpet 2Examples that Check for Items in a Player"s InventoryFinally, you can use the /clear command to check if an item is in a player"s inventory. This is done by setting maxCount to 0 in the /clear command.

To check the number of enchanted golden apples that carolannpeacock.com has in inventory:

/clear carolannpeacock.com appleenchanted 0 0

Example in Education Edition

To remove all items from your inventory in Education Edition:

/clearTo clear carolannpeacock.com"s inventory:

/clear carolannpeacock.comTo clear apples from all players" inventory:

/clear
a appleTo clear 7 apples from all players" inventory:

/clear
a apple 0 7To clear birch wood planks from the nearest player"s inventory:

/clear
p planks 2

How to Enter the Command

1. Open the Chat Window

The easiest way to run a command in Minecraft is within the chat window. The game control to open the chat window depends on the version of Minecraft:

For Java Edition (PC/Mac), press the T key to open the chat window.For Pocket Edition (PE), tap on the chat button
*
at the top of the screen.For Xbox One, press the D-Pad (right) on the controller.For PS4, press the D-Pad (right) on the controller.For Nintendo Switch, press the right arrow button
*
on the controller.For Windows 10 Edition, press the T key to open the chat window.For Education Edition, press the T key to open the chat window.

2. Type the Command

In this example, we will remove all items from your inventory with the following command:

/clearType the command in the chat window. As you are typing, you will see the command appear in the lower left corner of the game window. Press the Enter key to run the command.

See more: Is It Illegal To Dumpster Dive In Texas, Weirdest Laws In Texas: Our Crazy State

Once the cheat has been entered, your inventory will be cleared:

You will see the message "Cleared the inventory of , removing xxx items" appear in the lower left corner of the game window to indicate that the inventory was cleared.