Here’s a little program for generating random holes in the landscape and automatically putting a candle at the bottom. The idea is that this could be run on the Raspberry Pi running as a server so that other players can have a little fun hunting for them.
I’ve discovered that candles don’t like being put underwater… no surprise there!
Screenshots have been created following the instructions at Raspberry Pi – Spy.
from mcpi import minecraft import time import random mc = minecraft.Minecraft.create() mc.postToChat("Python is now in control!") def Molehole(x,y,z,depth): mc.setBlocks(x,y+40,z,x+0,y-depth,z+0,0) #clear the space first mc.setBlock(x,y-depth,z,50) #Put a candle at the bottom of the tunnel for loop in range(20): startx = random.randint(-120,120) startz = random.randint(-120,120) starty = 0 Molehole(startx,starty,startz,20)