{"id":704,"date":"2016-12-18T22:45:19","date_gmt":"2016-12-19T04:45:19","guid":{"rendered":"http:\/\/mycomputerninja.com\/?p=704"},"modified":"2016-12-19T16:51:13","modified_gmt":"2016-12-19T22:51:13","slug":"getting-tnt-to-work-in-minecraft-pi-edition","status":"publish","type":"post","link":"https:\/\/mycomputerninja.com\/?p=704","title":{"rendered":"Getting TNT to work in Minecraft Pi edition."},"content":{"rendered":"<p>Here are some steps to get the TNT to work in Minecraft Pi edition. <\/p>\n<ol>\n<li>Copy the following code block into a file called &#8220;tnt.py&#8221;. Save the file anywhere you want<\/li>\n<li>Start Minecraft pi edition and enter an environment instance. <\/li>\n<li>Start lxTerm or whatever terminal program you like to use<\/li>\n<li>cd to the directory where you saved the tnt.py file.<\/li>\n<li>execute &#8216;chmod 777 tnt.py&#8217; to change the file runnable permissions. <\/li>\n<li>execute &#8216;python .\/tnt.py&#8217;.<\/li>\n<li>switch back to minecraft<\/li>\n<li>place a block of TNT<\/li>\n<li>right-click on the block<\/li>\n<li>your console should report something like &#8220;block data is now 1&#8221;<\/li>\n<li>left click the block with your pick 1 time.<\/li>\n<li>big badaboom.<\/li>\n<\/ol>\n<p><code><br \/>\nimport mcpi.minecraft<br \/>\nimport time<\/p>\n<p>mc = mcpi.minecraft.Minecraft.create();<\/p>\n<p>while True:<br \/>\n\thits = mc.events.pollBlockHits()<br \/>\n\tfor hit in hits:<br \/>\n\t\tblock = mc.getBlockWithData(hit.pos.x, hit.pos.y, hit.pos.z);<br \/>\n\t\tblock.data = (block.data + 1) & 0xf;<br \/>\n\t\tmc.setBlock(hit.pos.x, hit.pos.y, hit.pos.z, block.id, block.data)<br \/>\n\t\tmc.postToChat(\"Block data is now \" + str(block.data))<br \/>\n\ttime.sleep(0.1)<br \/>\n<\/code><\/p>\n<p><!--adsense--><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here are some steps to get the TNT to work in Minecraft Pi edition. Copy the following code block into a file called &#8220;tnt.py&#8221;. Save the file anywhere you want Start Minecraft pi edition and enter an environment instance. Start lxTerm or whatever terminal program you like to use cd to the directory where you saved the tnt.py file. execute &#8216;chmod 777 tnt.py&#8217; to change the file runnable permissions. execute &#8216;python .\/tnt.py&#8217;. switch back to minecraft place a block of&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/mycomputerninja.com\/?p=704\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,3],"tags":[],"class_list":["post-704","post","type-post","status-publish","format-standard","hentry","category-how-to","category-programming"],"_links":{"self":[{"href":"https:\/\/mycomputerninja.com\/index.php?rest_route=\/wp\/v2\/posts\/704","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mycomputerninja.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mycomputerninja.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mycomputerninja.com\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/mycomputerninja.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=704"}],"version-history":[{"count":2,"href":"https:\/\/mycomputerninja.com\/index.php?rest_route=\/wp\/v2\/posts\/704\/revisions"}],"predecessor-version":[{"id":722,"href":"https:\/\/mycomputerninja.com\/index.php?rest_route=\/wp\/v2\/posts\/704\/revisions\/722"}],"wp:attachment":[{"href":"https:\/\/mycomputerninja.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=704"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mycomputerninja.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=704"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mycomputerninja.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=704"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}