I set a command block to /tp. It was supposed to activate only if you had 0 time left, and to activate the command block with a hopper clock to keep giving it power.

But it is not checking if you have 0 time left, so it keeps teleporting me. I can't get close enough to the command block to break it, so I'm stuck in a neverending teleport loop.

Any ideas?

  • If you are running on a Mac with Time Machine (or equivalent) - then the easiest way to fix this is to restore from the last working backup. You can find the saved game data in /Users/<username>/Library/Application Support/minecraft.
    – Reefwing
    Commented Aug 20, 2022 at 2:47

12 Answers 12


If you are running this world on a multiplayer server, you can disable command blocks completely via the server properties. Shut down the server, open server.properties with a text editor of your choice and set

enable-command-block = false

This disables all command blocks. Join the game, destroy the command block in question and reenable them afterwards.

In singleplayer, it's a bit more complicated. You have to open the world as a multiplayer* server. Open server.properties and set

level-name = [relative path to your savegame]

e.g. saves/world (use / to divide folders).

*If you haven't run a multiplayer server yet, you can download the server.jar (or server.exe) from the Minecraft website and save it wherever you want. Run it once to generate some files, including server.properties and a savegame called world.

To join your own server, connect to localhost or in Minecraft.

  • 1
    I think that this solution works best if you're already running a server.
    – Riking
    Commented Jun 2, 2014 at 9:14
  • I'm a little surprised there isn't a game rule for this, that you have to do it through server properties.
    – MBraedley
    Commented Jun 24, 2015 at 0:24

For situations like this, an external world-editing tool is best. Find the command block, and delete it.

A common one is MCEdit, which is available here: http://www.mcedit.net/

As @MrLemon mentions, you could be running a multiplayer server, in which case MCEdit is a bad idea -- the download time of a 60GB map is non-negligible. In that case, follow his answer.

/fill X1 Y1 Z1 X2 Y2 Z2 minecraft:air

Fill in X Y and Z with the approximate coordinates of the command block, and you've replaced a region around the command block with air.


Another alternative is to change the command using NBTExplorer. This tool is much less powerful than MCEdit, but it easier to use and does work for this case. This works largely the same as my answer here, so feel free to reference that in case something is unclear. The crucial thing is that you have to remember either where your command block is located, or any semi-unique part of your command.

Command Blocks are Tile/Block Entities, since a regular data value is not enough to store all information about them. Instead, they have NBT data similar to entities, which are detailed on the wiki. In particular, command blocks ("Control") have a Command entry. NBTExplorer is able to read the region format and search for a Tile Entity with a specific entry.

  1. Close Minecraft. Open up the program and select File > Open Minecraft Save Folder. You will get a list of folders corresponding to your worlds. Open up the world you want to search, and select the "Region" folder.

  2. Use Search > Find (Ctrl+F) to look for Name: Command and Value: [your command snippet] until you have found the command block in question (This is described in greater detail in the answer linked above).

  3. Double-Click the Command entry and change it's value to either fix the command directly (for example, turn \kill @e[type=!player] into \kill @e[type=!Player]) or just enter something harmless (e.g. leave it empty).

  4. Press the save button and close NBTExplorer. When you open up your world in Minecraft, the command should be changed.


Destroy the block using a world editor, then use a command block to comparator for the test part with the /testfor command.

You want the comparator to go to a command block that just puts up a message to find out if the /testfor command and comparator are working properly. Do not start the /tp command until you have confirmed that the first two parts are working in conjunction with each other properly.


You could change the gamerule randomTickSpeed to 0.

Something similar happened to me: I was being teleported 5 blocks up with a command block in a Minecart on a powered activator rail. They activate every 4 game ticks.

  • 4
    randomTickSpeed has absolutely nothing to do with activating command blocks. It affects only the random ticks responsible for growing plants and such.
    – MrLemon
    Commented May 20, 2015 at 8:45

If the command block is not at the spawn; type /kill.

But if one is at spawn just look down real quick and break it if you can.

  • You can't. It kills you too fast. Commented Sep 26, 2016 at 11:03

For Bedrock Edition, just type the following command in chat:

/gamerule commandBlocksEnabled false

This will disable command blocks. Then type this when you are in a safe position:

/gamerule commandBlocksEnabled true 

This will re-enable command blocks.

  • 1
    Works on Nintendo Switch version. Commented Jan 23, 2021 at 16:33
  • This is a minecraft-java-edition question. Posting answers that only apply to a completely different game is unhelpful.
    – pppery
    Commented Jan 30, 2021 at 1:27
  • 2
    @pppery - Not really. This answer is useful to users finding this question through Google, regardless of how it is tagged. Plus, the answer was posted before the java/bedrock tag split - when this question was just tagged [minecraft] and applied to both versions of the game. There was always going to be some overlap - not every question can or should be split cleanly down the middle.
    – Robotnik
    Commented Feb 1, 2021 at 22:28

What you could do, is go into the chat, and use the set block command to set the command block to a block of air.


Step 1 figure out the coordinates of the command block that is teleporting you

Step 2 do the following: /fill (x coordinate of the command block) (y coordinate of the command block) (z coordinate of the command block) (x coordinate of the command block) (y coordinate of the command block) (z coordinate of the command block) minecraft:air

For example, if the command block is at 34 55 -2769 do /fill 34 55 -2768 34 55 -2768 minecraft:air

  • 5
    This is a similar answer to the answer Rainbow Dash gave two years ago. Also, if you are only trying to replace one block, the setblock command does not require you enter the same coordinates twice.
    – IronAnvil
    Commented Aug 12, 2017 at 17:49

You could turn to Creative mode and fly so it can't reach you if it is below you as a pressure plate... I don't really know if it'll work, but you can try it! ^_^

  • Please only answer if you have an answer, otherwise comment. This solution does not work.
    – Jayden
    Commented Sep 8, 2019 at 7:35

If all else fails, use /summon PrimedTnt to blow up the command block.

  • 10
    This doesn't work. Command blocks have an incredibly high blast resistance, and won't be blown up by a single piece of TNT. The best that can be hoped for is to blow up the clock, but there are even clocks that can't be blown up (like a 20 Hz clock).
    – MBraedley
    Commented Jun 20, 2015 at 18:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .