How to explode TNT in Minecraft pi

Step-1: Install Minecraft pi.

sudo apt-get update
sudo apt-get install Minecraft-pi

Step-3:Open Python.

Then type in this command

import mcpi.minecraft
import time

mc = mcpi.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)

Step-4: open Minecraft pi.

Type minecraft-pi in the terminal

Step-5:

Save and run the python command

Step-6: igniting the TNT

Right click with the sword and left click to ignite the TNT

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Azaan Hasan

Azaan Hasan

2 Followers

Student studying in class-8 , tech lover, cuber and programmer..