Until recently I had never played Minecraft but it’s popularity meant it was something I felt I had to try. I installed the free pocket edition on my Nexus 7 to try it out and as a result decided to give it a go on the Pi.
Using the Pi to run Minecraft opens up the possibility to interact with the 3D world using Python. This is something that particularly interested me. You can build structures using the normal interface but on the Pi you’ve got the chance to control that world using scripts to create and edit blocks.
The Pi Edition is similar to earlier versions of the Pocket Edition and only offers “Creative” mode. Therefore it’s not as advanced or fancy as the versions you may be used to playing on other platforms.
So lets get started!
2016 UPDATE:
The latest version of Raspbian already includes Minecraft so you don’t need to install it manually. I highly recommend getting the latest image from the Official downloads page. It also includes a desktop icon. The section “Using Minecraft” will still be useful so take a look at that.
Installation
I suggest starting off with a fresh installation of Raspbian on your SD card. The latest image can be downloaded from http://www.raspberrypi.org/software/
Boot the Pi, login and then type the following command :
startx
This will run the graphical interface. Click the LXTerminal icon to open a terminal window. Use the following command to download the Minecraft package from the official site :
wget https://s3.amazonaws.com/assets.minecraft.net/pi/minecraft-pi-0.1.1.tar.gz
Then use the following to unzip the contents :
tar -zxvf minecraft-pi-0.1.1.tar.gz
This should have created a directory and extracted some files into it. Let’s open that directory :
cd mcpi
Then finally you can run the application using :
./minecraft-pi
The Minecraft window should open and look something like this :
Click “Start Game” to dive in and generate a new world to explore.
Minecraft runs at a fixed resolution so your screen may look different depending on your monitor settings. You can maximise the window and run full screen but this may affect your mouse pointer. Be prepared to start using the keyboard!
Add Desktop Icon
It’s a bit of a pain to open a command prompt every time you want to play but it is easy to create a short-cut icon on the desktop.
First, save this image to your computer as “minecraft.png” and copy it to your Pi and into your mcpi folder.
Right-click on your LXDE desktop and select “Create New” followed by “Blank File”
Name the file “minecraft.desktop”. Click OK and the short-cut file should appear on the desktop.
Right-click on this new .desktop file and select “Leafpad”. The file will open in the “Leafpad” text editor.
Copy the following code into “Leafpad” :
[Desktop Entry] Name=Minecraft Pi Edition Comment=Launch Minecraft Pi Edition! Exec=sh -c 'cd ~/mcpi && lxterminal -l -t Minecraft -e ./minecraft-pi' Icon=/home/pi/mcpi/minecraft.png Terminal=false Type=Application Categories=Application;Games; StartupNotify=true
Using the “File” menu save the file and exit “Leafpad”.
The short-cut should now have a nice icon and a title of “Minecraft Pi Edition”.
Double-clicking the icon will launch Minecraft.
Using Minecraft
This isn’t the place to give an extensive guide to using Minecraft but I thought I would present some basics to get you moving around the environment.
ESC Pause/Menu W Move forward A Move left S Move backwards D Move right E Show inventory of blocks 1-8 Select items in the quick-bar Left mouse Destroy blocks Right mouse Place blocks Space Jump (ascend in fly-mode) Shift Sneak (descend in fly-mode)
The mouse can be used to change your point-of-view. The scroll wheel can be used to scroll through the items, the left mouse button being used to select a block. When viewing the inventory you can use the WASD keys to move the selection using the Enter key to select a block.
Double-tapping the Space bar will activate and deactivate fly-mode.
You can exit Minecraft by clicking the [x]in the top right hand corner of the game window.
Python API
The Python API allows you to control the Minecraft world. It is installed by default so you can start using it straight away. It’s a great way to build structures and learn Python at the same time.
Take a look at all my other Minecraft related articles.
28 Comments
It was this version that got my daughter hooked on Minecraft (I have to take full responsibility!)
I was a little disappointed with the limitations of this version compared to the full versions on PC and iPad until I discovered that you can access Minecraft with a Python API.
I’m a long way from being an expert, what I have learnt has mostly come from
Stuff About Code
My project is to combine Minecraft with the GPIO to shine different LEDs depending on what I’m standing on. Stuff About Code has some very cool examples including clocks that update in realtime
I think lots of people might be disappointed as the official information doesn’t quite make it clear this is a basic version. I’ve not played the full-featured versions so I haven’t been spoilt with new features. The Python API is what interested me. The “Stuff About Code” has some excellent information and I’m sure will help me get started. Just need to think of a novel Python idea to try out. Interfacing with real hardware offers some cool possibilities!
Hello, very useful post. My son is playing it on the Raspberry Pi but is not sure how to save the world he has created. Therefore, he has to start in a new world every time. Is this the way the R-pi version works or is there a way to save your world?
Regards
Chris
We have the same problem (can’t save worlds). Have you found an answer? Does anyone know?
Could there be a problem with permissions on one or some of the Minecraft directories?
Thanks.
Well, no one replied at all, but just in case someone finds this: I solved it. The problem was ownership/permissions of the invisible .minecraft directory and subdirectories.
How did you solve the problem ? How did you fix “ownership/permissions of the invisible .minecraft directory and subdirectories ” ?
Please what was the answer to being able to save the worlds, by fixing directories….thanks
When I try to extract the tar file using tar -zxvf minecraft-pi-0.1.1.tar.gz, an error occurs saying:
tar (child): minecraft-pi-0.1.1.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
Any ideas on why this may be?
If it is saying “No such file or directory” then the tar.gz file isn’t there or it’s got a different name. Type “ls” to list the files in the current directory and double-check.
I had exactly the same problem. I found this was because i clicked the download link from the minecraft website. I then followed these instructions from the beginning and it worked no problem. Basically, delete whatever you have now and start again using the steps here!
clear out the files that may be already down loaded…use the wget https://s3.amazonaws.com/assets.minecraft.net/pi/minecraft-pi-0.1.1.tar.gz
right in the terminal don’t send it to a file just type it in and execute. I was having the same issue. Once I did this I was able to decompress the file and it worked! Good luck
Hi I’ve got Minecraft working on my R Pi following your instructions above. Only thong that hasn’t worked saving the minecraft.png file . It saves as a blank file. Any suggestions? Thanks!
Does it save ok on your PC? When you click the image link in the tutorial do you see the image ok in your browser?
I get to the part where I put in “./minecraft-pi” and it gives me the following error message: “./minecraft-pi : cannot execute binary file” does anyone know what to do with that?
try “sudo ./minecraft”
and also make sure you are in the proper working directory related to your script.
any chance this would work under retropie? or is it set in the raspian windows?
When I type in that command into LXTerminal it says it’s connecting to s3.amazon.com but then it says Connection refused.
Did the file get removed?
The file is definitely there. If you put the URL into a normal PC web browser it downloads. It’s also still listed on the the official http://pi.minecraft.net/ site.
On my Raspberry Pi, Minecraft Pi is preinstalled on the desktop. When I double click the icon, a black box appears and the game does not load. I am talking to the Pi over VNC, if that makes a difference.
In the latest Raspbian image Minecraft is pre-installed. Unfortunately you can’t run Minecraft remotely as far as I am aware. You can be using the Pi with a monitor connected.
Okay, thanks.
I wonder if anyone can help me. My children and I are trying to get minecraft to work on an pi. We are able to launch it, but after the world is created the pointer is very sluggish and we can only make a couple of selections using keys before the pi freezes and we have to reboot. It is B model with 512MB. We are overclocking it set at Turbo and the GPU memory is split to 256. As far as I can see it is hardfloat. I got the kids very excited about minecraft and would really like to get it working. Any suggestions very welcome.
Turn the overclocking off and see if it works OK then. It could be a problem with the power supply so if you’ve got an alternative give that a try as well. Also are you using the latest Raspbian image?
Thanks to all the contributors for Mindcraft pi, I had no idea it would be such a hit with the kids. I love the fact it’s an in to python script too, (lots for us to learn) 🙂 (I am running the latest wheezy image and mind craft came preloaded.)
I’m running my pi on an old TV and have been tweaking the config.txt file in /boot/ to position the display image on the screen.
I believe mindcraft is using the overscan commands in config.txt, to position the image on the screen relative to its launch window, so it displays off to one side – and is scaled way beiger than the screen. I can adjust it by resizing the window to get it to fit, but this is more than a 7 year old can do given one can’t see the window behind the mindcraft screen.
I am looking for some script I can add to the Icon file to have it launch at a cretin size and position to avoid the need to adjusting the window size at start up.
I’ve found this (http://www.raspberrypi.org/forums/viewtopic.php?f=27&t=32892) which I have yet to test that will allow me to set the window size, but I was wondering how does one set the window position? (and size if there is another way)
Any help welcome.
And many thanks.
hi
minecraft is set up and working. however, when trying to use a coding window to write directly to minecraft, the books and the net say use TAB to switch the cursor from mineccraft to the editor. TAB doesn’t work and i can’t move the cursor out of minecraft without pressing ESCAPE and stopping minecraft.
ideas?
thanks
rob
Try Alt+Tab which should scroll through the running X-windows apps
I need help to save the world my 9 year old just built on his Pi3. I have him saved in Python Shell but the file is very small, I am not sure if it is saved and I don’t know how to get it to run again once you saved the .py file.
A Minecraft World itself must be saved from within the Minecraft game interface. If you exit it should be saved using the name of the World when it was created. That should save all the blocks etc. A Python script can be saved as a .py file. To quickly check the contents of a py (or any text file) you can type
cat myfile.py
on the command line. To run a python script you can use :
sudo python myfile.py
Obviously replace “myfile.py” with the name of your file.