Hardware Reference
In-Depth Information
Quick Reference Table
Importing the Minecraft API Creating a connection to Minecraft
import mcpi.minecraft as minecraft mc = minecraft.Minecraft.create()
Getting the player's tile position
Posting a message to the Minecraft chat
pos = mc.player.getTilePos()
mc.postToChat("Hello Minecraft")
x = pos.x
y = pos.y
z = pos.z
Setting the player's tile position
x = 5
y = 3
z = 7
mc.player.setTilePos(x, y, z)
Achievement Unlocked: Creator of an exciting game that changes as your
player moves around in Minecraft.
In the Next Adventure...
In Adventure 3, you'll learn how to automate the building of large structures such
as houses, using Minecraft blocks and Python loops. With a Python program you
can build huge structures much faster than you could build them by hand. You
will be able to construct a whole Minecraft town in Python in less time than it
takes your friends to build it manually.
Search WWH ::




Custom Search