How can I kill all entities outside the world in Minecraft?

I have summoned 100000 items and now I can't enter my world... What can I do? Is there any way to kill all entities inside it?


Solution 1:

You could make a (local) server and excute the kill command using the console.

  1. Download the server JAR for your version (this can be found on the Minecraft Wiki, just search up the version number you're using, and download the server jar from the sidebar)

  2. Make a new folder in a place that you'll remember (like your Desktop), and copy the server JAR here.

  3. Enable file name extensions in Windows Explorer (top bar in view section), and create a new text file.

  4. Rename said text file to start.bat

  5. If you haven't already done so, install Java from java.com

  6. Click rename on the server jar file, and copy the full name of it. Then click off it.

  7. Right-click the start.bat file and click on Edit. Then type this into it:

java -Xmx1024M -Xms1024M -jar server.jar (replace server.jar with the name of the jar file you downloaded.

  1. Go to your minecraft world saves folder (usually: %appdata%\.minecraft\saves), then copy the world (whole folder) with all the items into the folder on your desktop that you made earlier.

  2. Rename the world folder that you copied to world

  3. Double-click the start.bat file, you will be prompted to edit a file called eula.txt and replace "false" with "true", do that

  4. Save and close the eula.txt file and then run the start.bat file again, wait a few moments, then once it says "Preparing Spawn Area: 100%", you should be able to type the command to remove the entities.

  5. Type kill @e[type=minecraft:item] into the command window with the server console.

  6. Type save-all and kill into the console.

  7. Copy the world folder back to your Minecraft saves directory (as shown in step 8), rename it if you wish.

  8. Test to see if the world works correctly (it should have world written in grey text below the name.

  9. If it works, you can delete the folder on your desktop as well as the broken world folder.

Hopefully this will work.