pre-release of minecraft on the Raspberry Pi and in particular the API, see this post for some background on the basics, and rather than watching 'Food Inspectors' on the tv, I thought I would see if I could write a game in minecraft (a game in a game I suppose) in an hour. This is what I came up with....
Minecraft - Hide and Seek!
The concept is really simple, a diamond block is hidden, at a random location, in the minecraft world and you have to find it and stand next to it and its quickest time wins. You are helped along the way by the game telling you whether you are getting "warmer" or "colder" and how far you are from the block!
I recorded this video using the the pre-release and you will notice towards the end of the video that it starts to go a bit weird, with a flashing screen and the player being moved about!
Download and run
You can download the code direct from git-hub, so run minecraft, open/create a world and follow the instructions:
If you want learn and have a go yourself, here's how:
Create a directory for the program
Copy the python api class library from minecraft to the programs directory
Create minecraft-hs.py python program
or open Idle and save minecraft-hs.py to the minecraft-hs directory
The complete code repository is also on github, https://github.com/martinohanlon/minecraft-hs.git.
Note - minecraft must be running and you must be in a game
or if using Idle, click Run Module