Blog Archives

MCPI Game Of Life

Jason Milldrum of has come up with a brilliant version of the popular game, ‘The Game Of Life‘. It uses Obsidian blocks to show dead cells and Diamond blocks to show alive cells on a 64×64 block board.

The code is pretty big, so to save the homepage of the site being filled by a single program, you can view the code here!

Credit goes to Jason Milldrum

How to run Python Programs on The Raspberry Pi

If you are new to the RPi, Python or just need a little bit of help. you may not understand how to run many of the Python Programs that you can find on this site and on the Minecraft Forums. Well, look no further. Below, I have come up with a guide to get you on your feet in the world of Python! You will be running programs in no time at all!

  1. First, you are going to need to create the program. Well, not create exactly, copy. But you still need to create a file for it to go. Open up ‘LeafPad‘ and paste the program code into the file.
  2. Save the program in your /mcpi/api/python/ dictionary. Name it something sensible. If it is a rainbow program, name it The .py allow the RPi to know that it is a Python file.
  3. Now, open up MCPI and load up a world.
  4. Open up a new ‘LXTerminal‘ and navigate to your /mcpi/api/python dictionary, by using the cd command:
    cd /mcpi/api/python
  5. Next, type:

    (Obviously you need to replace ProgramName with whatever you called the file).

  6. The program should now be running.

If this guide doesn’t work for you at first, try again. If on the third time you still don’t succeed, leave a comment!

Python: Auto Rainbow

This cool little program designed by ‘500 Internal Server Error‘, automatically builds a rainbow in your MCPI world, upon loading the python file.


The code is as follows:

import mcpi.minecraft as minecraft
import mcpi.block as block
from math import *
colors = [14, 1, 4, 5, 3, 11, 10]
mc = minecraft.Minecraft.create()
  height = 60
mc.setBlocks(-64,0,0,64,height + len(colors),0,0)
  for x in range(0, 128):
  for colourindex in range(0, len(colors)):
  y = sin((x / 128.0) * pi) * height + colourindex
  mc.setBlock(x - 64, int(y), 0,, colors[len(colors) - 1 - colourindex])


The original thread where the program was shared can be found here.

To run the program, open up ‘LeafPad‘, copy this code into it and save it in /mcpi/api/python as a .py file. Save it as Then, once you have a MCPI world loaded up, open up ‘Terminal‘ and navigate to where you saved the file using cd and type python