{"id":390,"date":"2017-06-18T01:25:34","date_gmt":"2017-06-18T01:25:34","guid":{"rendered":"https:\/\/www.triptera.com.au\/wordpress\/?p=390"},"modified":"2017-06-18T02:40:10","modified_gmt":"2017-06-18T02:40:10","slug":"python-in-minecraft-5-hollow-tunnel","status":"publish","type":"post","link":"https:\/\/www.triptera.com.au\/wordpress\/2017\/06\/18\/python-in-minecraft-5-hollow-tunnel\/","title":{"rendered":"Python in Minecraft 5 &#8211; hollow tunnel"},"content":{"rendered":"<h2>Creating a hollow tunnel with walls at each end<\/h2>\n<p>To create an air space in the tunnel we can use another loop. However, the second loop should not go all the way to the ends because we want walls at each end. This is to stop water and lava flowing into our tunnel should the ends of the tunnel meet these liquids.<\/p>\n<p><code>nano hollowglasstunnel.py<\/code><\/p>\n<pre class=\"brush: python; title: ; wrap-lines: false; notranslate\" title=\"\">\r\nimport mcpi.minecraft as minecraft\r\nimport mcpi.block as block\r\nmc=minecraft.Minecraft.create()\r\nxmin = -224\r\nxmax = -200\r\ny = 72\r\nz = -222\r\nfor x in range(xmin,xmax+1):\r\n    mc.setBlocks(x,y,z-2,x,y+6,z+2,block.GLASS)\r\nfor x in range(xmin+1,xmax):\r\n    mc.setBlocks(x,y+1,z-1,x,y+5,z+1,block.AIR)\r\n<\/pre>\n<p><code>python3 hollowglasstunnel.py<\/code><\/p>\n<p><a href=\"https:\/\/www.triptera.com.au\/wordpress\/wp-content\/uploads\/2017\/06\/hollowglasstunnel.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.triptera.com.au\/wordpress\/wp-content\/uploads\/2017\/06\/hollowglasstunnel-300x169.png\" alt=\"\" width=\"300\" height=\"169\" class=\"alignnone size-medium wp-image-376\" srcset=\"https:\/\/www.triptera.com.au\/wordpress\/wp-content\/uploads\/2017\/06\/hollowglasstunnel-300x169.png 300w, https:\/\/www.triptera.com.au\/wordpress\/wp-content\/uploads\/2017\/06\/hollowglasstunnel-768x432.png 768w, https:\/\/www.triptera.com.au\/wordpress\/wp-content\/uploads\/2017\/06\/hollowglasstunnel.png 854w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Creating a hollow tunnel with walls at each end To create an air space in the tunnel we can use another loop. However, the second loop should not go all the way to the ends because we want walls at each end. This is to stop water and lava flowing into our tunnel should the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","footnotes":""},"categories":[13],"tags":[],"class_list":["post-390","post","type-post","status-publish","format-standard","hentry","category-coderdojo"],"_links":{"self":[{"href":"https:\/\/www.triptera.com.au\/wordpress\/wp-json\/wp\/v2\/posts\/390","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.triptera.com.au\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.triptera.com.au\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.triptera.com.au\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.triptera.com.au\/wordpress\/wp-json\/wp\/v2\/comments?post=390"}],"version-history":[{"count":1,"href":"https:\/\/www.triptera.com.au\/wordpress\/wp-json\/wp\/v2\/posts\/390\/revisions"}],"predecessor-version":[{"id":391,"href":"https:\/\/www.triptera.com.au\/wordpress\/wp-json\/wp\/v2\/posts\/390\/revisions\/391"}],"wp:attachment":[{"href":"https:\/\/www.triptera.com.au\/wordpress\/wp-json\/wp\/v2\/media?parent=390"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.triptera.com.au\/wordpress\/wp-json\/wp\/v2\/categories?post=390"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.triptera.com.au\/wordpress\/wp-json\/wp\/v2\/tags?post=390"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}