Minecraft Pi

We have Minecraft on the Mac, iPad, iPhone and on Raspberry Pi. We also have versions of minecraft being played with lego, with Stattys, and in conversation endlessly. Minecraft is addicting.

Each version has different constraints and possibilies. You can’t visit the Nether in iPad version, you can only play in Creative mode on the Pi, and you need to have been very well behaved to get to play it on the Mac.

The boys favourite version at the moment is the least capable. It’s the Rasp Pi one. I’m pretty sure it’s because it runs on their computer.

minecraft on the pi

Easier than ever

A recent update to Raspbian means that you get Minecraft by default if you download a new image (including NOOBS). Find it here.

Minecraft on the Pi comes with a Python module that lets you write Python scripts that do things in Minecraft land. This is great fun – and a great way to get little people interacting with code. Changing some variables to change a dirt block to a TNT will never get old when you’re 6.

The docs for getting started with minecraft, and the full API Reference should give you plenty to get your teeth into, and make it really easy to get the Hello World up and running. Even if your Python is weak to non-existent like mine.

There is some great starter code in the docs – take this example – dropping flowers behind you as you walk.

from mcpi import minecraft
from time import sleep

mc = minecraft.Minecraft.create()

flower = 38

while True:
    x, y, z = mc.player.getPos()
    mc.setBlock(x, y, z, flower)
    sleep(0.1)

How simple is that? You can make the Minecraft world bend to your will through numbers and letters, not just by waggling the mouse and typing W A S D.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.