# How to Remove Items from Minecraft Player Inventories (/docs/minecraft/remove-items-inventory)



Sometimes you need to remove items from players — whether it's a duped item, a banned weapon, or clearing inventories for an event. Here's how to do it.

Using Vanilla Commands [#using-vanilla-commands]

Clear a player's entire inventory [#clear-a-players-entire-inventory]

```
/clear <player>
```

This removes **everything** from the player's inventory, including armor and offhand.

Clear specific items [#clear-specific-items]

```
/clear <player> <item> <max_count>
```

Examples:

```
/clear Steve diamond_sword          # Remove all diamond swords
/clear Steve diamond 64             # Remove up to 64 diamonds
/clear Steve tnt                    # Remove all TNT
```

Clear items by NBT data [#clear-items-by-nbt-data]

Remove items with specific enchantments or custom data:

```
/clear Steve diamond_sword{Enchantments:[{id:"minecraft:sharpness",lvl:10}]}
```

Using EssentialsX [#using-essentialsx]

If you have [EssentialsX](/docs/minecraft/setup-essentialsx) installed:

| Command                    | Description                         |
| -------------------------- | ----------------------------------- |
| `/clearinventory <player>` | Clear entire inventory              |
| `/ci <player>`             | Short form                          |
| `/remove <item>`           | Remove item type from nearby ground |

Removing Items Server-Wide [#removing-items-server-wide]

Remove dropped items from the ground [#remove-dropped-items-from-the-ground]

```
/kill @e[type=item]
```

This removes all dropped item entities. Useful for clearing lag from item farms or duplication exploits.

Remove specific dropped items [#remove-specific-dropped-items]

```
/kill @e[type=item,nbt={Item:{id:"minecraft:diamond"}}]
```

Remove items from all players [#remove-items-from-all-players]

To clear a specific item from every online player:

```
/clear @a <item>
```

Using Plugins for Advanced Management [#using-plugins-for-advanced-management]

ClearLag [#clearlag]

[ClearLag](/docs/minecraft/setup-clearlag) can automatically remove ground items on a timer:

```
/lagg clear          # Remove ground items
/lagg killmobs       # Remove mobs
```

CoreProtect [#coreprotect]

If you need to track where duped items came from, use CoreProtect to inspect item transactions:

```
/co inspect          # Toggle inspect mode
/co rollback u:<player> t:1h a:+container   # Roll back container actions
```

Common Scenarios [#common-scenarios]

Removing duped items [#removing-duped-items]

1. Identify the duped item and affected players
2. Use `/clear <player> <item>` on each player
3. Fix the dupe exploit (update server, patch plugin, etc.)
4. Check player [ender chests](/docs/minecraft/edit-player-data) — dupers often stash items there

Pre-event inventory wipe [#pre-event-inventory-wipe]

For events that require clean inventories:

```
/clear @a                    # Clear all inventories
/effect clear @a             # Remove all effects
/xp set @a 0 levels         # Reset XP
/gamemode adventure @a       # Set gamemode
```

> ⚠️ **Warning:** The `/clear` command is irreversible. Always [backup](/docs/minecraft/backups-vs-autosave) before mass-clearing inventories. Consider notifying players first.

> 💡 **Tip:** For scheduled item cleanup (reducing lag from ground items), set up [ClearLag](/docs/minecraft/setup-clearlag) instead of manually running commands.

See also: [ClearLag](/docs/minecraft/setup-clearlag) | [Edit Player Data](/docs/minecraft/edit-player-data) | [Ban/Unban Players](/docs/minecraft/ban-unban-players)

If you need help, join our [Discord](https://discord.xgamingserver.com/).
