Hello, Minecraft

I’m going to be doing some tinkering with Minecraft on the Raspberry Pi. Specifically,
writing some code to do some building using the Python interface.

For Older Installations…

Minecraft has been installed by default on Raspbian images for a long time, and more recent
Raspbian images have the API installed by default so that you can write and run your scripts
from anywhere. If you have an older image without the API, you can get it either by opening
a terminal and typing:

Python

To start writing scripts against our brave new world, you will need to create a
new folder to store your python scripts. For ease, we can copy the contents of the
mcpi folder into the new code folder. If you have a more recent version of Raspbian,
you can run a script from any folder and it will work.

cp -r ~/mcpi/api/python/* .

Once that’s done, we are ready to start programming in Minecraft. First you will need
to create a new python source file, say hello.py, like this: