Want to try to program with the new Minecraft Pi API but don't have a Raspberry Pi yet?

RaspberryJuice implements a subset of the Minecraft Pi modding API for Bukkit servers.

The plugin listens on port 4711, and accept most of the Minecraft Pi commands, which are documented at http://wiki.vg/Minecraft_Pi_Protocol .

The plugin supports the majority of the api's supplied with the Pi edition and most examples will work.

Minecraft Forums thread

Currently implemented commands:

Protocol details:

The origin (0,0,0) is defined as the spawn location of the first loaded world. The player methods from the protocol acts on the only player on the server.

Extra features(^):

getBlocks(x1,y1,z1,x2,y2,z2) has been implemented
getDirection, getRotation, getPitch functions - get the 'direction' players and entities are facing
getPlayerId(playerName) - get the entity of a player by name
pollChatPosts() - get events back for posts to the chat
multiplayer support
- name added as an option parameter to player.# calls
- modded minecraft.py in python api library so player "name" can be passed on Minecraft.create(ip, port, name)
- this change does not stop standard python api library being used
the default tcp port can be changed in config.yml

^ to use the extra features an modded version of the java and python libraries that were originally supplied by Mojang with the Pi is required, https:github.com/zhuowei/RaspberryJuice/tree/master/src/main/resources/mcpi. You only need the modded libraries to use the extra features, the original libraries still work, you just wont be able to use the extra features


This Python script builds a rainbow near the spawn. Place this example in the api/python directory of the Minecraft Pi prerelease, start the server on the same computer, and run python name.py to run, replacing name.py with the actual name of the script.

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, y, 0, block.WOOL.id, colors[len(colors) - 1 - colourindex])

Result: http://i.imgur.com/3SFrE.png

Further examples can be found at http:www.stuffaboutcode.com/p/minecraft.html

You must login to post a comment. Don't have an account? Register to get one!

  • Avatar of crystallize1 crystallize1 Jun 09, 2015 at 19:21 UTC - 0 likes

    Hello. Been dreaming about this for years. Does it support if-else-break operators? Do I have to install actual Python?

    Last edited Jun 09, 2015 by crystallize1
  • Avatar of LetHopeItsSnowing LetHopeItsSnowing May 01, 2015 at 13:52 UTC - 0 likes

    @Chardinok: Go

    Hi, do you have any more information? What do you mean doesnt work? Do you get errors when launching bukkit?

    Or do you mean you cant download Bukkit? - because that is a different problem and nothing to do with RaspberryJuice.

    If you have more information, can you raise an issue on github? https://github.com/zhuowei/RaspberryJuice

  • Avatar of aberts10 aberts10 Apr 19, 2015 at 22:00 UTC - 0 likes

    @Chardinok: Go

    Use a later version like 1.8


  • Avatar of Chardinok Chardinok Apr 17, 2015 at 18:37 UTC - 0 likes

    This does not work! i am using 1.6.4 and i tried to download it still nothing! HELP!

  • Avatar of AvonVII AvonVII Sep 25, 2014 at 09:19 UTC - 0 likes

    @DavePottsUK: Go

    Many thanks Dave, much appreciated, will give that a whirl.


  • Avatar of DavePottsUK DavePottsUK Sep 24, 2014 at 21:11 UTC - 0 likes

    @AvonVII: Go

    You are right that it doesn't necessarily match. Raspberry Juice takes (0,0,0) to be the world spawn point. If you want the coordinates to match up then go over to the CraftBukkit server console and type

    setworldspawn 0 0 0
  • Avatar of AvonVII AvonVII Sep 24, 2014 at 20:47 UTC - 0 likes

    Perhaps I'm missing something obvious, but if I use player.getTilePos() the values returned don't match the Minecraft X,Y,Z coordinates like the do on the Pi.

    For example, Minecraft reports x:866,y:67,z:608, but mc.player.getTilePos() returns 18,2,-2

    I've got some code that scans an area and writes out a CSV of the blocks, on the Pi it's fine, but with the running it using the Raspberry juice plugin it is scanning the wrong place. :-(



  • Avatar of murilopolese murilopolese Sep 16, 2014 at 20:36 UTC - 0 likes

    Hey! Awesome work! I owe you guys a beer!

    I am working with some friends for Kids Hack Day and one of our programs is to teach kids how to program with Minecraft. We are using right now Raspberry Pi but it's quite frustrating for them to go home and not being able to practice what they learned.

    We will run a Game Development program inside Minecraft from middle of October to December and definitely we'll user your plugin to enable the littles to keep programming after the classes.

    One thing we are working right now is an abstraction (almost a game engine) to build mini-games inside Minecraft. Hide and seek, capture the flag, sokoban, treasure hunt and many other examples are on our scope.

    I noticed that you only exposed one type of events, even Bukkit expose more than that, are you guys planning to expose them entirely? Would be possible to us to contribute on your roadmap by developing or suggesting features?

    Since now, thank you very much for your work, it's really inspirational!

  • Avatar of LetHopeItsSnowing LetHopeItsSnowing Sep 16, 2014 at 06:14 UTC - 0 likes

    @XMrPotatoX: Go

    Fixed the issue with getentities in v1.4

  • Avatar of LetHopeItsSnowing LetHopeItsSnowing Sep 16, 2014 at 06:13 UTC - 0 likes

    1.4 has been released...

    Its mainly bug fixes but it does include the ability to change the TCP port by modding the config.yml.


Date created
Jan 08, 2013
Last update
May 02, 2016
Development stage
Apache License version 2.0
Curse link
Recent files