Getting TNT to work in Minecraft Pi edition.

Getting TNT to work in Minecraft Pi edition.

Here are some steps to get the TNT to work in Minecraft Pi edition.

  1. Copy the following code block into a file called “”. Save the file anywhere you want
  2. Start Minecraft pi edition and enter an environment instance.
  3. Start lxTerm or whatever terminal program you like to use
  4. cd to the directory where you saved the file.
  5. execute ‘chmod 777’ to change the file runnable permissions.
  6. execute ‘python ./’.
  7. switch back to minecraft
  8. place a block of TNT
  9. right-click on the block
  10. your console should report something like “block data is now 1”
  11. left click the block with your pick 1 time.
  12. big badaboom.

import mcpi.minecraft
import time

mc = mcpi.minecraft.Minecraft.create();

while True:
hits =
for hit in hits:
block = mc.getBlockWithData(hit.pos.x, hit.pos.y, hit.pos.z); = ( + 1) & 0xf;
mc.setBlock(hit.pos.x, hit.pos.y, hit.pos.z,,
mc.postToChat("Block data is now " + str(