Playing with the Minecraft API and a Raspberry Pi


It hasn’t been a week since Minecraft for the Raspberry Pi has been released, and already we’re seeing some cool builds that bridge our analog world with Minecraft voxel land. [Martin] got his hands on the Raspi version of Minecraft and decided to take advantage of the API Mojang threw into the build by making a huge analog block clock that keeps real world time in the Minecraft universe.

Basically, [Martin] created a small Python script that draws the face and hands of a clock in a Minecraft world. The Minecraft API comes with neat functions such as drawCircle, and drawLine, so making a real clock face is as simple as getting the system time and doing a bit of trig.

After the break you can check out [Martin]’s Minecraft clock in action. If you’re running the Pi version of Minecraft, you can also get this running on your machine with the code on [Martin]’s git.

8 thoughts on “Playing with the Minecraft API and a Raspberry Pi

  1. Thanks for posting about my clock. Not wishing to take anything away from mojang, but they dont supply functions to draw a circle or a line, i had to make them myself, although now i have, anyone can use them, got to love open source!

    1. Hmm… I also tried it using putty and Xming. And it gave me an error message as well:
      pi@raspberrypi ~/picraft/mcpi $ ./minecraft-pi
      vchiq_lib: Incompatible VCHIQ library – driver version 2 (min 2), library version 6 (min 3)
      * failed to open vchiq instance
      pi@raspberrypi ~/picraft/mcpi $

      I did notice that there is a new download of Raspbian “wheezy” from the 2013-02-09 on the RPi site. So I’m thinking that i either need to setup a new SD card with this or else that picraft is intentionally limited to only work with the local display output and that it will not work with a remote X servers.

      1. The fix I saw is:
        sudo chmod 777 /dev/vchiq
        Still doesn’t seem to work with ssh -X though, I just get a black screen with both putty/xming and in ubuntu.
        I think your probably need to install vnc or something like that to really play it remotely.

        1. To update this: It appears that minecraft won’t render over VNC either. You need to have a physical monitor connected. You should still be able to use the API from a remote connection, however.

  2. Having worked with building mods and plugins for things like Bukkit, this seems way too easy. I haven’t used a Mojang-official API yet, but if this exists for proper PC Minecraft I shall have to give it a try.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s