Sneak peek – some more Minecraft: Pi Edition video

As you’ll know (unless you’ve been hiding under a rock, or very busy wrapping presents), we’re expecting to see the release of Minecraft: Pi Edition from Mojang very soon. Daniel Bates, a PhD candidate at the University of Cambridge and the Raspberry Pi Foundation’s Undercover Minecraft Operative, has put together a video demo of how you’ll be able to use code within the Minecraft environment, programming the world to make building faster and easier.

Daniel says:

Note that this is a very early pre-release version, and it is subject to change before release. I’ll show off more features including interactive stuff in future videos.

Source code:
http://www.cl.cam.ac.uk/~db434/files/minecraft.py
http://www.cl.cam.ac.uk/~db434/files/setblockdemo.py

FAQ:
Q. Can I use X programming language?
A. Any language capable of communicating over the network will work. See the first source file as an example of what’s needed.

Q. When is it coming out?
A. No date has been confirmed yet.

Q. How much will it cost?
A. Nothing.

Q. Will it run on a 256MB Raspberry Pi?
A. Yes – this demo was filmed on an older model, and didn’t use any overclocking.

49 comments

Avatar

Amazing!

Avatar

Would you be able to get to put spectator cameras in the world, so you can allow people to make movies, like what half-life mods (or any other for that matter) use to make theirs… would be cool to see kids being able to do action shots in mine craft! :D

Avatar

Oh and would there be control blocks?

Avatar

You will be able to use a player as a camera (I’m not sure if that’s how the other spectator cameras work) – you can set the player’s position and what they’re looking at.

There are no control blocks at the moment

Avatar

Any more specs on the MC Pi Ed interface? That looks easy to do and I’ll start up a Perl module for it.

Avatar

I am very curious to hear if they will be able to increase the world size that the pocket editions are currently stuck with. Minecraft lan party anyone?

Avatar

I have a bunch of MCEdit filters that build things (Mobius strip, gordian knot, shells etc) which you are welcome to use in showcases. It’s Python.

See Reddit submissions

Avatar

Do you need to have your Raspberry Pi connected to the Internet to use this?

Avatar

Nope – I have never connected this Pi to the network.

Avatar

Thanks for the reply, I needed to know, NOW I’M EXCITED ABOUT THE RELEASE OF THIS A LOT!

Avatar

Pi release has been delayed until the new year, rumour has it :-/
https://mobile.twitter.com/danfrisk/status/282545396201422848

Avatar

Once Friday had passed, I suspected that might be the case – because I’m sure the guys at Mojang need a Christmas break just as much as we do!

Avatar

As indeed we all do ;-)
I’m thinking how little I would be doing on the pi if it had been ready now, so maybe it’s a Good Thing.
T.

Avatar

that. is. awesome.

Avatar

Interesting thing I saw a couple days ago- when I googled “minecraft pi edition” one of the results was “Minecraft Pi edition available for download”, from mojang.com, so I clicked on it and it gave me a 404. DREAMS CRUSHED

Avatar

That’s because they ‘accidentally’ posted an early build on their blog. You can find a link floating around. It has a fairly complete API, but somethings aren’t complete.

Avatar

I saw that too, when I googled it…

Avatar

Anyone think I should port this to Python 3? I could also add more colours.

Avatar

I meant more colors for both…

Avatar

I get an error:

File “minefracft.py”, line 7
_sock.connect((ip,port))
^
IndentationError; unexpected

Avatar

same please help us!

Avatar

Run LXTerminal, use the “cd” command to get to the directory the file is in.
Then, type “python”. Once that has come up in LXTerminal, type “import minecraft as mc”.

Avatar

1. Will there be a multiplayer?
2. Can we connect to another Pi and control that?

Avatar

Yes and yes.

Avatar

Thanks for the reply, but I have yet another question (sorry…) what kind of multiplayer, like online or lan?

Avatar

LAN, though there are programs available which can tunnel LAN connections over the internet.

Avatar

Thanks.
Could VPN work?

Avatar

My big question is will it be opensource, or at least support mods. I really want to use this to build a programming tutorial, and I want to build the lessons in as events in the game.

Avatar

The game itself will be closed source, but all of the API stuff will be.

There won’t be official mod support, but the API should be pretty capable.

Avatar

Hi George..
Started python via Terminal as you suggested.. unfortunately the indent error remains..:-(
——snip—————-
pi@raspberrypi ~/mcpi $ python
Python 2.7.3rc2 (default, May 6 2012, 20:02:25)
[GCC 4.6.3] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
>>> import minecraft as mc
Traceback (most recent call last):
File “”, line 1, in
File “minecraft.py”, line 7
_sock.connect((ip,port))
—————-snap———
I tried some “trial and error” indent changes without luck

Avatar

Wasn’t it me that told you…
Try downloading the file again and run it from LXTerminal.

Avatar

Hello, I managed to fix the indentation errors (about 5-6 of them?),
and definded port and ip as what is specified by connect()’s definition.
Then, it has the errno “111” connection refused/something like that.
I tried the “import minecraft as mc” trick after navigating to minecraft.py’s location to no avail, having the same error.

Avatar

Defined*, oops.

Avatar

I assume (and hope) that it will be available on the Pi store? And dlc like texture packs and mods (if it IS open source and moddable) would work well as something similar to the gmod dlc pages, but I’m sure people would cope with an apt style code based database!
Can’t wait for the full release!

Avatar

It’s totally up to Mojang how they decide to distribute it – but I hope it’ll be available in the Pi store too!

Avatar

Does the wire protocol work for other minecraft servers as well besides Raspberry Pi? I’m playing around with it on Mac OSX and can connect to the minecraft port:

telnet 127.0.0.1 50338

but as soon as I send the string:
set-block(0,0,0,2)

the server hangs up on me. Is this protocol specific to the Pi minecraft server? If so, any guidance on libraries available to talk to other servers? I did find the server wire protocol in the Minecraft wiki but it’s not as elegant as this!

Avatar

The protocol is specific to the Raspberry Pi version, but it is possible to add the same functionality to the normal game using mods. I think there are people working on that at the moment.

Avatar

Can you get survival mode on Minecraft PI edition?

Avatar

Not at the minute, but I hope there is Survival, Crafting, redstone and pistons soon. I know someone on minecraftforums has made a mod so mobs can spawn.

Avatar

Where is the download I would love to mod this :D
Or is it even released yet?

Avatar

Theres a pre-release download, search google for “minecraft pi gameplay and download”
There should be a few results. If you need help with the API, just ask.

Avatar

Can I write my own API for MCPI?

Avatar

You can build your own API on top of the one provided, but the game is only programmed to understand a limited set of commands. There is quite a lot more available than I’ve shown so far, though.

Avatar

Thanks, going to simplify it a little bit so I can remember it all…

Avatar

How do i get python to interact with minecraft pi? I have done import minecraft as mc but i dont know what to do next? Help please!!!!

Avatar

Assuming you have Minecraft running, you can use mc.connect() to set up a connection for sending commands, and then use mc.setblock(x,y,z,type) to build stuff.

If you have the game already, though, it likely came with a much more fully-featured codebase from Mojang. Look in the api folder.

Avatar

you should upload it to the pistore!

Avatar

Wow really cool cant wait till i get it thx you should teach us how to program it!

Avatar

I type mc.connect() and I just get an error, any help?

>>> import minecraft as mc
>>> mc.connect()
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'module' object has no attribute 'connect'

Leave a Comment

Comments are closed