Minecraft Java Edition – How to Remove All Items of a Specific Type on a Minecraft Server

minecraft-commandsminecraft-java-edition

My goal is to remove all existing Elytras from our server (only on the overworld, but not much of a problem otherwise, since we can just respawn the end).

I read about the command /kill @e[type=Item] on reddit. It did not work for me somehow. I tried it using: /kill @e[type=elytra] and got the message "Selector '@e[type=minecraft:elytra]' found nothing. Entity type type 'minecraft:elytra' is invalid". I took one out of the chest, threw it on the ground, but I get the same message.

The entity type cannot be invalid IMHO, since /give <playername> elytra works.

Best Answer

Commands can't target entities in unloaded chunks, and are generally bad at editing the contents of containers. To do what you want to do, you will need to use an external tool.

Here's how to do it with MCEdit Unified:

  1. Double click on any chest containing an elytra to bring up the chest GUI:

MCedit Chest GUI

  1. Select the elytra in the item list
  2. Press Delete All Instances Of This Item From World
  3. You'll get a warning message telling you what you're about to do, to which you should press OK

Warning message

  1. After it's done deleting the item (may take a while) save and exit.

This should only affect the current dimension you're in on MCEdit, so you will not need to regenerate the end.