Tag: Raspberry Pi

Python on Raspberry Pi

For a bit of a change the class were programming in Python on a Raspberry Pi.

The program below was used to create a Gold Block in Minecraft.

1
2
3
4
5
6
7
8
from mcpi . minecraft import Minecraft
import mcpi . block as block
mc = Minecraft . create ()
pos = mc. player . getPos ()
x = pos.x
y = pos.y
z = pos.z
mc. setBlock (x, y, z, block . GOLD_BLOCK .id)

Created using http://hilite.me/ and http://www.geocraft.org.uk/