Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk9 min

How to Remove Items from a Player Inventory or Ender Chest in Minecraft

Use /clear for normal inventories, then use edition-specific slot replacement commands to remove items from a Minecraft Ender Chest.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The command depends on both the storage you are changing and your edition of Minecraft. Use /clear for a player’s normal inventory. In Java Edition, use /item replace entity <player> enderchest.<slot> with air for an Ender Chest slot. In Bedrock Edition, use /replaceitem entity <player> slot.enderchest <slot> air. Test on one player with @s or a player name before targeting everyone.

The procedures below cover removing one item type, limiting the number removed, emptying a normal inventory, and clearing selected Ender Chest slots. Java and Bedrock use different command grammars, so do not mix examples between editions.

As an Amazon Associate I earn from qualifying purchases.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Identify your edition before entering a command

Java Edition and Bedrock Edition expose different command arguments and Ender Chest slot targets. The same-looking command can fail if it is entered in the other edition.

Task Java Edition Bedrock Edition
Remove an item from a normal inventory /clear <targets> <item> [maxCount] /clear [player] [itemName] [data] [maxCount]
Remove all normal-inventory items /clear @s /clear @s
Remove one Ender Chest slot /item replace entity <player> enderchest.<slot> with air /replaceitem entity <player> slot.enderchest <slot> air
Required authority Command permission or operator access Cheats enabled and Game Director/operator permission
Best fit Precise item counts and datapack or command-block automation Normal-inventory clearing and slot-by-slot command-block use

Check permissions and choose a safe target

Commands do not bypass permissions. In Java, you need the appropriate command permission or operator level. In Bedrock, enable cheats and ensure the executor has Game Director/operator permission.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

Start with yourself:

  • @s means the player executing the command.
  • A player name targets that named player, for example Alex.
  • @a targets every player currently in the world. Reserve it for a deliberate, verified wipe.

For a command block, remember that @s refers to the command executor. If you want the command block to affect a particular player, use that player’s name or an appropriate selector instead of assuming @s means the nearest player.

Place a command in chat only after checking the item name, target and maximum count. A quantity-limited command is safer than an all-items command when you are removing a prohibited or duplicated item.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Java Edition: remove items from a normal inventory

Remove up to a precise number of one item

Java uses this form:

/clear [targets] [item] [maxCount]

To remove up to 64 dirt from your own normal inventory, run:

/clear @s minecraft:dirt 64

The command searches the targeted player’s normal inventory for the named item and removes no more than the specified maximum. If the player has fewer than that amount, only the items that exist are removed. Replace @s with a player name to affect someone else.

Use the namespaced item identifier accepted by Java, such as minecraft:dirt. For another item, substitute its identifier; do not use a display name copied from an item’s tooltip if it is not a valid command identifier.

Remove every copy of one item

Omit the maximum count when you want the command to remove all matching copies from the targeted normal inventory:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

/clear @s minecraft:dirt

This does not remove unrelated items. It also does not address Ender Chest storage; use the Ender Chest procedure later in this guide.

Empty the complete normal inventory

After confirming that the target is correct, run:

/clear @s

Replace @s with a specific player name when an administrator is clearing somebody else’s inventory. Do not substitute @a unless the intention is to remove normal-inventory items from every online player.

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

Use a command block or datapack safely

  1. Test the command in chat on a controlled player or a test world.
  2. Keep the target narrow while testing: use @s or one exact player name.
  3. For a recurring rule, put the tested command in a command block or datapack function.
  4. Only then broaden the selector, and document whether the command removes one item type or everything.

A datapack or command block does not change what /clear targets: it still works on the player’s normal inventory, not the Ender Chest.

Bedrock Edition: remove items from a normal inventory

Understand Bedrock’s argument order

Bedrock documents the command as:

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

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The data argument occupies a position between the item and quantity. For a standard item match, use -1 as the data value. To remove up to 64 dirt from yourself, enter:

/clear @s dirt -1 64

Bedrock item names in this form are written without Java’s minecraft: namespace. Use a player name instead of @s when an operator is acting on someone else.

Remove all copies of one item

Keep the item and data arguments, but omit the maximum count when you want every matching copy removed:

/clear @s dirt -1

If your version requires the optional arguments to be supplied explicitly, retain the documented order and use the command suggestions shown by the in-game parser. The important distinction is that -1 is the data position, not the quantity.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Empty a player’s normal inventory

To clear all items from your own normal inventory, omit the item arguments:

/clear @s

Use a named player for a specific target. Treat @a as a global wipe: it affects every player selected, not only the person standing near the command block.

Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

Bedrock checklist

  • Cheats are enabled in the world.
  • The person or command block running the command has Game Director/operator permission.
  • The item name is valid for Bedrock.
  • -1 is in the data argument position when using an item-specific command.
  • The final number is the maximum count, when a limit is required.

Why /clear does not remove Ender Chest contents

/clear is documented for the player’s normal inventory. An Ender Chest is separate storage, so clearing the normal inventory leaves its contents untouched. Use an Ender Chest slot target instead.

Ender Chest commands are slot-based: identify the slot index you want to empty, replace that slot’s contents with air, and repeat for each additional slot. This lets you remove selected slots without destroying the rest of the Ender Chest.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Java Edition: clear selected Ender Chest slots

Prerequisite and target form

Java 1.17 introduced /item replace targets that can address an entity’s Ender Chest slot. The clearing form is:

/item replace entity <player> enderchest.<slot> with air

For example, to clear slot 0 for a player named PlayerName:

/item replace entity PlayerName enderchest.0 with air

Use @s in place of the name when the executing player should be affected:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

/item replace entity @s enderchest.0 with air

On Java versions before 1.17, this /item replace Ender Chest target is not available. The command syntax in this section therefore requires Java 1.17 or newer.

Clear several slots without touching the rest

  1. Open the Ender Chest and identify the slot or slots that must be emptied.
  2. Run the command for the first index, such as enderchest.0.
  3. Change only the slot number for the next slot, for example enderchest.1, and run it again.
  4. Verify the result before placing the commands in a repeating command block or function.

Each invocation replaces one addressed slot with air. There is no item filter in this form: if the slot contains an item, that slot is replaced; if it is already empty, nothing useful is removed.

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.

Understand Mojang’s documented source-target example

Mojang’s Java 1.17 example is:

/item replace block ~ ~ ~ container.0 from entity @s enderchest.0

That example copies an Ender Chest slot into a container slot. To clear the Ender Chest itself, use the same enderchest.<slot> path as the destination and replace it with air, as shown above. Do not leave the from entity portion in a clearing command; that portion is for copying an item from a source.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Automate only after a one-slot test

For a scheduled cleanup, put one tested replacement command per slot in a function or command-block chain. Keep the player target explicit. A chain that uses a broad selector can erase the same slot for every selected player, so test with one named player or @s first.

Bedrock Edition: clear selected Ender Chest slots

Use the Ender Chest slot identifier

Bedrock command references expose Ender Chest storage through the slot.enderchest inventory slot form. To clear slot 0 for a player named PlayerName, run:

/replaceitem entity PlayerName slot.enderchest 0 air

For yourself, use:

/replaceitem entity @s slot.enderchest 0 air

The command has four important parts: the entity target, the literal slot group slot.enderchest, the numeric slot index, and the replacement item air.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Clear more than one slot

  1. Run the command for the first slot you intend to remove.
  2. Change the numeric index for the next slot and run the command again.
  3. Repeat only for the slots that should be empty.
  4. Check the player’s Ender Chest before automating the sequence.

This method is intentionally slot-by-slot. Bedrock’s documented /clear command does not provide the same Ender Chest target used for normal inventory clearing, so do not expect /clear @s to empty an Ender Chest.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Choose the right command for the result you want

Desired result Java command Bedrock command
Remove up to 64 dirt from yourself /clear @s minecraft:dirt 64 /clear @s dirt -1 64
Remove all dirt from yourself /clear @s minecraft:dirt /clear @s dirt -1
Empty your normal inventory /clear @s /clear @s
Clear Java Ender Chest slot 0 /item replace entity @s enderchest.0 with air Not applicable; use the Bedrock command in the next column.
Clear Bedrock Ender Chest slot 0 Not applicable; use the Java command in the previous column. /replaceitem entity @s slot.enderchest 0 air

Troubleshooting command failures

“Unknown or incomplete command”

Check the edition first. Java expects a namespaced item such as minecraft:dirt, while the Bedrock example uses dirt and includes the data argument. Bedrock also uses /replaceitem for the Ender Chest procedure shown here, not Java’s /item replace syntax.

The command runs but the wrong player is affected

Replace a broad selector with a named player or @s. In particular, inspect every command-block target: a selector such as @a intentionally includes all selected players.

The normal inventory changed, but the Ender Chest did not

This is expected when you used /clear. Run the edition-specific slot replacement command and supply the correct Ender Chest slot index.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Only part of the unwanted item was removed

Check the maximum-count argument. A value such as 64 is an upper limit, not a promise that an additional stack will be removed. Omit the maximum count when the goal is to remove every matching copy from the targeted normal inventory.

A Bedrock item-specific command fails at the number

Verify the argument order: player, item name, data, then maximum count. The Bedrock form /clear @s dirt -1 64 uses -1 for data and 64 for the limit. Swapping those positions changes how the parser interprets the command.

An Ender Chest command clears the wrong slot

Slot paths are exact. In Java, the number follows enderchest.; in Bedrock, it is the separate number after slot.enderchest. Re-open the Ender Chest, confirm the index you intend to change, and test one slot before repeating the operation.

Operational safeguards for worlds and servers

  • Use a backup or a test world before running an all-inventory or multi-slot cleanup.
  • Prefer a named player or @s while validating a command.
  • Use an item-specific maximum count when removing a limited amount.
  • Keep normal-inventory commands and Ender Chest commands in separate command-block chains so their scopes remain obvious.
  • Record the exact edition and command version in a datapack or command-block note; Java 1.17 or newer is required for the Java Ender Chest target described here.
  • When testing a player-specific cleanup, ask that player to confirm both their normal inventory and Ender Chest before expanding the target.

Quick decision guide

  1. If the item is in the nine-row player inventory, hotbar, or other normal inventory storage, choose /clear.
  2. If you need only one item type, include the item name; if you need a limited quantity, add the maximum count.
  3. If every normal-inventory item must go, omit the item arguments only after checking the target.
  4. If the item is in an Ender Chest, identify the edition and replace the relevant slot with air.
  5. Use one player first, verify the result, and automate or broaden the target only after the command behaves as intended.

Frequently Asked Questions

Can I use /clear to empty an Ender Chest?

No. /clear addresses the player’s normal inventory. Use Java’s /item replace entity ... enderchest.<slot> with air or Bedrock’s /replaceitem entity ... slot.enderchest <slot> air for Ender Chest slots.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What is the safest target selector for testing?

Use @s when the command is executed by the player who should be affected, or use one exact player name. Avoid @a until the command has been verified.

Why does the Bedrock command contain -1?

Bedrock places a data value between the item name and maximum count. In /clear @s dirt -1 64, -1 is the data argument and 64 is the removal limit.

Which Java version supports the Ender Chest /item replace target?

Java 1.17 introduced /item replace targets that can address an entity’s Ender Chest slot.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.