Playing with the Minecraft API and a Raspberry Pi

mine

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.

Comments

  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!
    Martin

  2. lloyd says:

    It’s a shame my Pi simply says something about invalid vichq, when I run MC.

    • Truth says:

      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.

  3. M4CGYV3R says:

    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:

WordPress.com Logo

You are commenting using your WordPress.com 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