Minecraft

The Raspberry Pi software includes a special version of the Minecraft virtual reality game with a Python API ( Application Programming Interface) to the Minecraft game. The API allows you to write Python scripts to create complex structures and operate an avatar in the Minecraft world.

The game can network over wifi so players see and interact with each other in a common virtual world. The game is very popular and a creative learning environment!

Students do progressive exercises in creating structures, tunnels using Python scripts within a cartesian framework. They learn by creating the scripts and seeing results instantly in the Minecraft world. Then modify the scripts and have fun experimenting!

Pi Shop Minecraft Python programming in a networked VR world on the Raspberry Pi !

Here's the Minecraft version of "hello world" using the API developed for the Raspberry Pi. Students run their scripts and see the message on their Minecraft game screen. It's a complex process made very simple on the Pi!

# script 1 Hello World

import mcpi.minecraft as minecraft

mc = minecraft.Minecraft.create()

mc.postToChat('Hello Minecraft World')


Here's a screenshot of the Mu editor used in the Pi Shop and a Python script that prints the player's current x,y,z position, and builds a stone tower 60 blocks tall. It shows the power of a 'for' loop that we expand to large structures, tunnels etc. Students can collaborate in a networked Minecraft world and each create structures and interact via Python scripts they develop.