Skip to content

Instantly share code, notes, and snippets.

@bennuttall
Created June 12, 2014 12:32
Show Gist options
  • Save bennuttall/ed25ccd24150893e46c5 to your computer and use it in GitHub Desktop.
Save bennuttall/ed25ccd24150893e46c5 to your computer and use it in GitHub Desktop.
Minecraft Pi Example
import mcpi.minecraft as minecraft
from time import sleep
mc = minecraft.Minecraft.create()
mc.postToChat("Welcome to Minecraft Pi")
x, y, z = mc.player.getPos()
sleep(1)
mc.postToChat("Your location is x: %s, y: %s, z: %s" % (x, y, z))
flower = 38w
while True:
x, y, z = mc.player.getPos()
mc.setBlock(x, y, z, flower)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment