import random, math, time import mcpi.block as block import mcpi.minecraft as minecraft mc=minecraft.Minecraft.create() v_height=0 while v_height <= 0: (tx, tz)=(random.randint(-125,125), om.randint(-125,125)) v_height=mc.getHeight(tx, tz) mc.setBlock(tx, v_height-2, tz, block.DIAMOND_BLOCK) vdistance = .sqrt(math.pow(mc.player.getTilePos().x-tx, 2) + math.pow(mc.player.getTilePos().z-tz, 2)) while mc.getBlock(tx, v_height-2, tz)!=0: vnewdistance= .sqrt(math.pow(mc.player.getTilePos().x-tx,2)+ math.pow(mc.player.getTilePos().z-tz, 2)) if vnewdistance == 0: mc.postToChat("Dig!") elif vdistance > distance: mc.postToChat("Warmer!") elif vdistance < distance: mc.postToChat("Colder!") else: mc.postToChat("Move!") vdistance=vnewdistance time.sleep(10) mc.postToChat("Treasure found... And destroyed!") mc.postToChat("Congratulations!")