Stuck In a command block induced death loop [duplicate]

I made a new world called "Fun With Redstone".

I had a "genius" idea to make a zombie killing mini-game, so I put in the super fast redstone clock /kill @e[Type=Zombie] and shortly after, realized my blunder.

My world is now stuck in a death loop where every time I respawn I just get killed again.

Can anyone help me to get out of that loop? Maybe there are hidden files or something? I don't wanna reset my whole world, since there are other projects there.


If you don't want to use MCEdit, you can still use NBT Explorer. Download it here.
Now, open it up and select your world.

Select your world

Then, you want to click on Search->Find. Tick the value box and enter your command or just a part of it.

Search for your command

After a short amount of time, NBTExplorer will have found the problem causing command block.

The command that causes trouble.

So now you can easily edit the command by double clicking on it. Make sure to click on the save button at the top, to ensure your changes got saved and you're done.


Use MCEdit to delete the command block or to break the redstone. Alternatively if you are fast enough you may be able to run a command before you die.


You can fix this without mods or external editors. A feature of the standalone Minecraft server is that it has a configuration option to disable command blocks. We can exploit this to save your game.

  1. Back up your save. (Always prudent.)

  2. Get and install the server somewhere on your local machine. (Follow the directions on the Minecraft Wiki if you've never done this before.)

  3. Run the server once to make sure it's working, and that you can connect to it. Then stop the server.

  4. Delete the contents of the server's world folder and replace it with a copy of the contents of your affected save folder.

  5. Edit the server's server.properties file. Change or add the line to say:

    enable-command-block=false
    
  6. Run the server and connect. Go find your errant command block and fix it or disable its clock. Wait a minute to make sure an auto-save happens, or just issue the save-all command in the server console. Stop the server again.

  7. Copy the contents of the server's world file into your singleplayer saves directory. (If you want to be super-cautious, copy this into a new save folder.)

  8. Play singleplayer and confirm that you don't die instantly anymore!


If it is by any chance on a server, go to your server properties folder and disable command blocks. After that, get back on your world and destroy the command block that is keeping you in the loop. Once finished, close your server and turn command blocks back on. Once you finished, it should be back to normal.