Categories
Design

How to run low-cost minecraft on a raspberry pi for block building on the cheap

If you’re a Minecraft fan and a Pi owner, you’ve probably already downloaded a copy of Minecraft: Pi Edition. But are you getting the most out of the fact that you can modify the world with code in-game?

If you’re not sure where to start, or if you’re looking for ideas (sometimes being given a blank canvas can be lousy for getting the brain sparking), Martin O’Hanlon at the marvellous has several tutorials on Minecraft: Pi Edition, from installing the game to using the Minecraft API to build wonderful things, like magical bridges that appear where’er you walk, games of hide and seek, and in-game analogue clocks.

The hide and seek hack is easy and rewarding: with a little coding you’ll be able to get the game to hide a diamond somewhere in the world for you to find, and to give you hints of the warmer/colder variety.

And we’re all agreed that the clock is just brilliant (it’s also big enough that you can go and stand on the hands). Again, the project has its own page with code and a spot of discussion.

We’d love to see what you’ve been doing in Minecraft – take some video, or write something about your experiments on your own website, and let us know about it!

Share this post

  • Minecraft
  • Stuff About Code
  • Martin O’Hanlon

Latest posts

Hackable Raspberry Pi Pico cyber glasses

Classify birds acoustically with BirdNET-Pi

The Atari 2600 is nearly 45 years old

Games console and projector hidden inside gorgeous wooden box

Next Post

How to run low-cost minecraft on a raspberry pi for block building on the cheap

The view from Gordon’s helmet

Previous Post

How to run low-cost minecraft on a raspberry pi for block building on the cheap

Recantha’s only gone and made a tricorder.

Share this post

16 comments

Kevvy Wilch

This might just be the catalyst that gets my two boys interested in coding 🙂

winkleink

Been playing with Minecraft and since I make a lot of mistakes I needed a fair few new blank worlds so I can see what I’m doing. When I mess one up too much I just restart with a different world allowing me to keep going with the coding.
I also copied the blank worlds so that when (not if) I mess up all the ones available I can just copy in new ones and start again. It’s a mix of python code and some manual editing in a hex editor. Nothing too complex.

Below is a short howto on what to do.

Mike Karthauser

One of the best resources ive come across for minecraft on the Pi is http://mcpipy.wordpress.com/ which includes many of the examples you’ve posted about as well as loads more. Even neater is that the site has its own GitHub repo where you can get all the python scripts ready to run on your Pi

Rui Andrade

I set up a minecraft server using my Pi. It runs well. There’s a topic dedicated to it on the forums!

Would you be able to write up a 2 page article with the info in your thread of the best working version?

Rui Andrade

Jim Manley

I assigned students in a 6th grade science class I teach (as part of the Troops To Teachers program) to build models of the water, carbon, and nitrogen cycles. A surprising number (including some long-term discipline problems who had shown no interest in school, much less science) asked if they could build them in Minecraft instead of the traditional plaster/cardboard/painted dioramas. I hesitated at first, knowing they would likely goof off and just play in default random worlds that came up when it start. It would be difficult to supervise all 56 kids working on all of the various physical and virtual models (just keeping them from covering each other in paint was enough of a challenge). To my amazement and surprise, though, they actually built some really intricate Minecraft worlds with all sorts of waterfalls, clouds, precipitation, and even animated evaporation and condensation representations. They were required to label everything and cleverly created all sorts of variations on the carved signposts included in the stock Minecraft collection of tools and materials.

I’ll never hesitate again to let students use Minecraft for projects (they’ll still need to be monitored to prevent goofing off … they are 6th graders, after all). It will be fascinating to see what they’re able to come up with when they dive fully into the programming capabilities.

Viva La Minecraft! 😀

Tim Rowledge

Don’t forget Bert’s Squeak bindings for Minecraft – which could probably be be extended to Scratch – as shown on
http://croquetweak.blogspot.ca/2013/02/smalltalk-bindings-for-minecraft-pi.html

Chris R

My two boys had a play with the MineCraft Pi and enjoyed it. My oldest (10) has been writing some Python scripts that can turn one sort of block into another, build spheres and together we put together a script that builds a house wherever you are standing (complete with fence, stairs, lights, windows and flowers). His biggest disappointment is the lack of redstone which he uses to build all sorts of devices in normal MineCraft and is hoping that this will be to come. In terms of its goal in encouraging programming it certainly has done that as he hadn’t looked at Python since playing with it a year or so ago.
Overall a positive from us.

yaconsult

Totally new to minecraft and decided to give it a try.

After following instructions, I found that when running minecraft I got the error: failed to open vchiq instance

A quick google reveals that the solution is to change the device’s permission with: sudo chmod 777 /dev/vchiq

After doing this, running minecraft opens a minecraft window, but it’s blank. Now, I am currently getting a remote desktop on the pi with xrdp as described here: http://www.raspberrypiblog.com/2012/10/how-to-setup-remote-desktop-from.html

Is it possible for minecraft to display output when using an xrdp connection or will it only work on the local display?

skwirl42

It only works on the local display. From what I’ve read it was necessary in order to get decent 3D performance.

Krystal

Sorry if this shows up more than once. I’ve sent it four times and it doesn’t show up. I’m 11 and I installed Minecraft on my Raspberry Pi. There were some challenges, but I did it. I blogged about it, but I think that when I put the URL for the blog, my message is called spam. You can go to raspberrypikid dot wordpress dot com to see it.

check out picraftmods.webs.com! you can download mods, post mods, and give mod suggestions!

Chris

How do you actually save your world so that you don’t have to start from scratch everytime?

Katie

Hey, I am deciding whether or not to buy a raspberry pi. I was wondering if you could go on regular minecraft servers with Pi edition. Please reply

Rasberry Pi 2 has considerable more power than the first generation Pi’s and make an excellent platform for running small servers. It can be a challenge making them stable over time, but thats part of the fun!

A lego house seems appropriate on a raspberry pi dedicated minecraft server.

I will be using a very simple startup script with screen.

Screen is a service that “captures” the terminal and gives multiuser access to terminals. Using it will also prevent the minecraft (java) process from being killed when we terminate our ssh connection.

To attache to an existing screen type:

This will enter screen if you have one screen session, or list possible sessions if there are more. To enter spesific session type screen -r .

The basic screen commands are:

Now that we know the basics of screen, lets return to our minecraft installation:

Create a folder for your install:

Get latest server jar (1.8.3 at time of writing):

Create startup script:

Start the server, it will exit the first time

The first time you start the server it will create a bunch of files. One of then is the eula.txt. Change eula=false to eula=true to agree to the EULA (just kill screen with ‘exit’ or ctr-c).

Start the server again, and off you go…

If you start screen (screen -r), remember to exit with ‘ctr-a d’.

import minecraft

If you already have a Raspberry Pi, feel free to skip to the next blog post.

Occasionally I have a discussion with someone about the Raspberry Pi and at some point I mention what a wonderful device this $35 computer is… they typically get excited they can do so much for just $35. And if I have the chance, I’ll try to adjust their expectations noting that it can cost “as little as $35” if you have all the “accessories” already.

So I wanted to try to lay out in this post just what it costs to get started – and hopefully this may be a useful list if you want to buy one yourself.

The Raspberry Pi is an amazing little computer and it only costs $35. However if you want to play minecraft pi or access the web, you’ll need a few more things including:

  1. a TV or PC Monitor capable of receiving a signal via HDMI. (For this post, I’ll assume only HDMI – although Raspberry PI includes analog/composite video and analog stereo support)
  2. A HDMI cable to connect from the Raspberry PI to the TV/Monitor.
  3. A cable to power the USB – e.g. a micro USB power cable with 1 amp of power.
  4. A 4GB+ SD card for local storage (including the operating system)
  5. A keyboard with USB connection
  6. A mouse with USB connection
  7. a USB Wifi 802.11b+ adapter so you can connect to Wifi. (You can also connect via Ethernet, but I’ll assume Wifi is what most people want)
  8. A USB hub (because the Pi includes 2 USB ports, and I’ve specified 3 USB devices above – Wifi, keyboard and mouse)
  9. And of course… the Rasbperry Pi device — 256MB of RAM or 512MB of RAM

Now for me, I already had everything else when I got the Rapsberry Pi. I had a micro USB device from my kindle ebook reader, with a USB charger. I had a keyboard, mouse and USB hub from an old computer. I did have to buy the USB Wifi adapter/chip, but my cost was closer to $35. If you have nothing though (other than a HDMI Capable TV/monitor) you’ll need to spend more like $130 (including the $35 for the Raspberry Pi).

Here’s how I came up with the $130 price. Newark.com (aka Element 14) is one of the manufacturers and retailers of the Raspberry PI – so via their web site I added the following to my cart:

And the total for the above was:

Add another approximately $8 for shipping and you get to $130…

So again — hopefully this will cost you less as you have some of the above things already not being used, but worst cast it’s like $130.

Is it worth it?

So if you’re asking whether it’s worth spending that much money for one of these devices? I’d say:

  1. If you are considering buying a kid a Raspberry PI vs. a low cost desktop/laptop PC — I’d say go for the PC! Yes you can access the web, etc with the Raspberry PI — but it’s slow and it’s more complex for a kid to start out.
  2. If you are considering buying this to experiment, play or other purposes — then absolutely go for it!

For me, as a father wanting to teach my kids more about computers — it was a great investment (and I just bought two more today).

Of course my bias is on software — and Rapsberry Pi is as much about connecting to to hardware of all types – and controlling it with software. That’s something you can’t get to the same degree on a PC..

Beware the starter kits — know what it includes and whether it’s important to you…

Again if you are mostly looking for how to get it up and running so you can interact with the software — the list above is what you need.

There are lots of great web sites that sell starter kits that include what you need to connect raspberry pi to other hardware — but not the mouse, keyboard, power, SD card, hdmi cable, etc described above. So look carefully at what’s included in these kits.

Are you looking at Raspberry Pi primarily as a way to play minecraft?

In that case, you should know that Minecraft Pi Edition is free — but it’s a subset of the full Minecraft experience on the PC. Minecraft Pi is based on Minecraft Pocked Edition and both are missing some features that many kids enjoy like the ability to connect to multiplayer servers across the internet.

What did I miss?

Hopefully the above is helpful — and make no mistake, I’m very excited about Raspberry Pi and I recommend to most people to get one — as long as they understand what it is they are and are not getting…

Please add your comments though on your view. If there are cheaper options to get a starter kit as described above – please add that in the comments as well!

Share this:

  • Reddit
  • Twitter
  • Facebook

Like this:

Writing this blog has been a lot of fun — far more than I expected. It was started as a way to collect the python programs Phillip and I found and to encourage ourselves and others to learn about Python by playing with Minecraft and Raspberry Pi. It’s been great to see how many people are discovering Minecraft PI Edition (MCPI) themselves and writing python scripts… and I given this is just v0.1.1 and a few weeks old, I expect it it will continue to take off.

Which is leading me to the realization — there is more already than Phillip and I can handle ourselves and we need the help of others to continue this. So I’m making a request for help!

If you are interested in helping, please drop us an email at [email protected] and if you have ideas on how you can help – please include that.

There is lots that can be done, here are a few ideas on how I’d like to get help from others — but if there is something you can do not on this list, please let us know!

  1. One time or repeat contributors – Write one or more articles to appear on the blog. It can be any topic related to Python (or Programming), Minecraft and Raspberry PI (or RaspberryJuice)
  2. Finding scripts – help us search the far corners of the the net for interesting creations we should highlight.
  3. Testing scripts – we have a number of scripts we haven’t had time to test out. Test them, grab some photos or even make a youtube video!
  4. Github updates – besides checking in the last scripts, we can discuss ideas on how to improve this resource further…
  5. Promotion – help us get the word out on how to program Minecraft in python on raspberry pi — and find others that can learn from the blog, and contribute!

Finally if you aren’t able to help — then please leave a comment to encourage us and note what you’d like to see on future blog posts. We have a wide range of interests among the readers and we’d like to get to know you better so we can prioritize creating the right content.

As always, thanks for reading and all the contributions to date!!

At Piper, we blend physical building and virtual storytelling to inspire the next generation of innovators.

Piper Computer Kit

Piper Make Starter

Piper Make Add-ons

Piper Make Online

Start your adventure with the Piper Make Starter Expedition Kit and our FREE, drag-and-drop coding lessons to build gadgets to help Piperbot and Pip! Built for Chromebooks or any other computer using a Chrome browser.

Be sure to check out our add-on widgets for more technology-building adventures! Learn More >

Virtual storytelling and missions inspire the process of building hardware.

Built-in Google integrations and educator guides make getting started easy.

Piper Make has already inspired 2,000 students in Detroit. Learn More >

Piper Make is a Best of 2021 STEM product named by Tech & Learning!

Build. Play. Invent. The sleeker, compact evolution of the Piper Computer Kit. With innovative storage elements like our magnetic supply drawer and foldable breadboard workspace, Piper Computer Kit V3’s compact design is ideal for classroom settings. Pair yours with the Sensor Explorer add-on!

Get yours for $299 _ BACKORDERED UNTIL JUNE 2022 _

“Judges liked its self-paced concept and especially favored its Minecraft-inspired lessons” – Kevin Hogan, Managing Director

“The Piper Computer Kit 2 stands out amid an impressive array of options as one of our top picks for the Best STEM Toy of 2020. What impresses us most is the level of building, coding, and understanding that kids (and adults!) can meet while having a blast.” – Dr. Mark Costner, STEM Toy Expert

“The Piper Computer Kit excelled during our evaluation process, scoring in the top 1 percentile of over 1,100 STEM products reviewed since 2014.” – Andrew Raupp, STEM.org Founder

Top 3 Computers for Introducing Your Kids to Comp Sci

With these clever kits, elementary schoolers can get in-depth, hands-on experience with the tech they’ll someday use to “make the world a better place.” – Adrienne So, Wired Magazine

My granddaughter learnt the pieces: motherboard, connectors, battery, screen. We talked about how computers worked (with the immense help of google for some terms and systems). That night, her face was glowing with excitement and pride. We spent the next several days ‘playing’ with it for an hour or so every day. Discovering what it could do or not. I was concerned that she would get bored as it is not a fancy colored machine, but it beat up any app and game she had for two reasons: she MADE it, and she felt she UNDERSTOOD it.

Alicia Castillo Holley

Piper Customer, Grandmother

This is an incredibly teaching tool and platform, cleverly disguised as a children’s toy. There’s a ton of educational products on the marketing trying to get kids interested in STEM – things like Snap Circuits, Goldieblox, LittleBits, Lego Mindstorms, even code.org. The problem is that they are good at the science, but aren’t actually “fun”. They’re great, but they’re really just an incremental step over other building blocks like Legos. Piper gives you the building blocks, captures the fun and power behind Minecraft, and then adds a whole engaging in-game story mode on top of that to give kids a REASON to use the building blocks. My 7 year old was building real physical circuits right out of the box, the same kind of circuits that I didn’t see until I was in engineering school! Incredible. Head and shoulders above and several generations ahead anything else on the market right now.

Piper Customer, Father

Piper is truly amazing. My 9 and 11 year old daughters could not wait to set it up. Once we had it running they dove right in without fear. They love the game so navigating was seamless to them. Piper may seem intimidating to adults but trust me, it is not intimidating to your kids. They will love it.

Piper Customer, Father

Great tool! My son has really started learning how to work on computers and develop a foundation for what could potentially become a career in his life.

Piper Customer, Father

Piper Customer, Teacher

Los Angeles, California

Piper Customer, Teacher

“I love Piper because it represents what enabled me to do all the great technology things in my life”

I was very pleased to see Mojang release the Pi Edition of Minecraft. Its one of my favourite games, and now I can hack it with Python.

As Mojang themselves say they are giving us a voxel rendering engine to play with. I have used it to whip up a quick digital clock.

Re: Digital Clock in Minecraft

Re: Digital Clock in Minecraft

How to run low-cost minecraft on a raspberry pi for block building on the cheap

Re: Digital Clock in Minecraft

Re: Digital Clock in Minecraft

Wow – just Wow

Re: Digital Clock in Minecraft

Wow this is really interesting – just ordered a Rasberry Pi to test out Minecraft Pi Edition.

Is it possible to program lower level control of graphics rendering – or only ‘in world’ things like blocks?

I’m working to make a voxel based 3D display ( volumetric display = http://en.wikipedia.org/wiki/Volumetric_display ) and if its possible to access the way graphics are written to the screen its possible we could make it so that people could play pi minecraft on a sort of ‘holographic’ display.

any help with this would be appreciated on the pi/minecraft end – thanks

Re: Digital Clock in Minecraft

Re: Digital Clock in Minecraft

@seankean:
My code just adds and removes blocks in the Minecraft word. Minecraft itself is responsible for all the rendering.

Minecraft renders down to a 2D plane and is probably not suitable for driving a real 3D display.
The Raspberry Pi has a 2D framebuffer but you would want a 3D volumebuffer.
Having said that, representing the world as a coarse collection of large, low-resolution blocks would probably really help with your project. And Mojang themselves might be interested in porting Minecraft once you have your display working.

Note that the full version of Minecraft has an anaglyphic mode which can give a better illusion of depth.

Re: Digital Clock in Minecraft

How to run low-cost minecraft on a raspberry pi for block building on the cheap

Re: Digital Clock in Minecraft

Re: Digital Clock in Minecraft

Re: Digital Clock in Minecraft

Just for fun I have moved on to a real-time analogue clock now.

I’d say that this one is “interestingly ugly”. The still picture does not do it justice. I’ll post a video later if I can work out how.
Yes, its just a few seconds after 7:00.

For this project I use PIL (Python Imaging Library) to draw lines and circles. I draw the clock at higher resolution then reduce it for display. It really opens your eyes to the problems that people who draw icons have with limited resolution.

The approach used here could be used for displaying real-world graphs in Minecraft.

Re: Digital Clock in Minecraft

Re: Digital Clock in Minecraft

Re: Digital Clock in Minecraft

>> Thanks for crossposting over there. Please also post the panel and analogue clock.

Done, thanks for sharing your creations.

How to run low-cost minecraft on a raspberry pi for block building on the cheap

Re: Digital Clock in Minecraft

Loving your work SleepyOz, digital clock is a particular master piece.

It gave me some inspiration to make my own analogue clock. I wanted to create one which was absolutely massive. big enough so I could walk on the arms.

Re: Digital Clock in Minecraft

When I run this I get sporadic Drained Data: messages. Nothing renders. Why would this be? Just grabbed latest Wheezy and Minecraft Pi. mcpi in same dir, etc.

Thanks. Trying to get into this / to get excited here.

Re: Digital Clock in Minecraft

blakespot wrote: When I run this I get sporadic Drained Data: messages. Nothing renders. Why would this be? Just grabbed latest Wheezy and Minecraft Pi. mcpi in same dir, etc.

Thanks. Trying to get into this / to get excited here.

Re: Digital Clock in Minecraft

So I was just wondering. Does this have to be done in Python 2 or 3?