Chapter 8

Minecraft

FOR THE UNINITIATED, Minecraft is a game of survival where your character can build things and acquire materials by mining the world around him. It's set in a world of blocks, and each of these blocks can be destroyed to reveal hidden treasures. Figure 8-1 shows a typical Minecraft world.

That's a pretty inadequate description, but it should give you an idea of what's going on. There's a full version that you can play on most computers, and there's a special version unique to the Raspberry Pi. The special thing about the Pi version is that you can control the game through Python. Not only can you move your player, but you can also manipulate the entire world around you.

Figure 8-1: The 3D blocks have become emblematic of this game.

9781118717059-fg0801.tif

Exploring Minecraft

That's enough trying to explain it, though. Minecraft is one of those things that you really have to see to understand. First of all, you'll need to download the software from http://pi.minecraft.net.

You should end up with a file called minecraft-pi-0.1.1.tar.gz. You can extract this archive through the terminal with this command:

tar zxvf minecraft-pi-0.1.1.tar.gz

Then, you can start the game with this command:

mcpi/minecraft-pi

Get Learning Python with Raspberry Pi now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.