Skip to content

Instantly share code, notes, and snippets.

@cbscribe
Created May 26, 2013 22:06
Show Gist options
  • Save cbscribe/5654168 to your computer and use it in GitHub Desktop.
Save cbscribe/5654168 to your computer and use it in GitHub Desktop.
Explode a TNT block
import minecraft
import time
mc = minecraft.Minecraft.create();
while True:
hits = mc.events.pollBlockHits()
for hit in hits:
block = mc.getBlockWithData(hit.pos.x, hit.pos.y, hit.pos.z);
block.data = (block.data + 1) & 0xf;
mc.setBlock(hit.pos.x, hit.pos.y, hit.pos.z, block.id, block.data)
mc.postToChat("Block data is now " + str(block.data))
time.sleep(0.1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment