I accidentally set off a large pile of TNT. I managed to hit escape before the explosion. Is there any way to prevent it going off?
If you open your world with MCEdit, you can select the area containing the TNT and use the “Delete Entities” operation to delete all the activated TNT in that area. (Note that Delete Entities will also remove any minecarts, boats, and wolves in the selection. MCEdit will show entities as transparent red blocks, but not what type of entity they are.)
Without such editing, by the physics of Minecraft, there is no way to stop activated TNT. However, you can prevent the explosion from having any effects on other blocks, including other TNT, by dumping water in the space where it will explode. (This probably can't help you fast enough unless you have a full bucket on your hotbar already.)
Hitting Alt+F4 would have been the wiser choice because by hitting Escape you invoked the game to save your world.
Alternatively you can quit the game, then delete (and backup) your
level.dat and rename your
level.dat. The problem is that you don't know from when the level.dat_old is. I just know that this saved my house from burning it down accidentally and the game was set back about 10 minutes.
Just thought I'd answer with one more solution: if you have Single Player Commands installed, you can use the
/defuse all command to remove all the TNT that is activated. The TNT blocks will disappear (since after activation, they are considered entities and not blocks), but each previously activated block will drop a TNT item in its place for you to pick up.
This is a nice solution because Single Player Commands pauses the game when you bring up the console with T, so you don't need to frantically type the command before it goes off.
This answer had been previously posted on this question
As said in this link, you could try to use :
/gamerule setExplosionDestruction false
This command would prevent any Creeper / TNT blocks to damage other blocks. If you want to re-enable block destruction, use :
/gamerule setExplosionDestruction true
NB : You need to play at least at version 1.4.2 Minecraft to have access to