TNT Trail!

Today on Minecraft Pi Edition I programmed a TNT trail. You walk around after the code has been ran, and TNT appears! Ignite some! Please note that not all the TNT is ignitable but the unignitable TNT still blows up when ignitable TNT blows up.

Copy and paste the code into Geany (or your preferred Python environment) and run it. Make sure you are on a world on Minecraft and hit the TNT that appears each step. Press CTRL +C in your Python environment to stop the TNT trail.

The code is here:

from mcpi.minecraft import Minecraft
from time import sleep

mc = Minecraft.create()
x, y, z = mc.player.getPos() # player position (x, y, z)
this_block = mc.getBlock(x, y, z) # block ID
print(this_block)
tnt = 46

while True:
x, y, z = mc.player.getPos() # player position (x, y, z)
block_beneath = mc.getBlock(x, y-1, z) # block ID

if block_beneath == tnt:
mc.setBlock(x, y, z, tnt, 1)
sleep(0.1)
else:
mc.setBlock(x, y-1, z, tnt)
Enjoy!

Epic Chas Gamer 🙂

 

 

 

 

 

Advertisements

About Epic Chas Gamer

I am a computer programmer who can create a mobile app for your website. I am also a Raspberry Pi expert and modern gamer, with Minecraft as my favourite. I develop ECG SeaSurf, a web browser only just released, crafting the future. The project is available for Windows and a BETA Linux version at coolchasgamer.wordpress.com/ecg-seasurf-unstable. I will also be voicing Shield Evil in "ECG Sir Wolf's Castle", as well as Chas and a few others. UPDATED ON 12th February 2017, at 14:46
This entry was posted in Uncategorized and tagged , , . Bookmark the permalink.

1 Response to TNT Trail!

  1. Unbelivably Epic Awesome Gamer says:

    Woo, hoo! This blog is so epic and amazing! I blew up my world and when I fell into the void I saw hardly any of the world left. Perfect for multiplayer!

    Like

Go on, you know you want to! Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s