ONE OF THE great things about programming in Minecraft is that in addition to looking at your creations on a 2D screen you can actually bring them to life in a virtual 3D world. You can walk around them, go inside them, make them bigger—even blow them up if you like! By using the ideas originally created to display 3D objects on a 2D screen, you can code 3D objects in Minecraft, turning the ordinary into the extraordinary.
In this adventure you find out how to use the
minecraftstuff module to create 2D lines and shapes, which, when combined with a little maths, allow you to program a clock so big you can stand on its hands as they go round (see Figure 6-1). After you have mastered creating 2D shapes, you then learn how to combine them to create enormous 3D structures in seconds.
The minecraftstuff Module
minecraftstuff is an extension module to the Minecraft API, which was written for Adventures in Minecraft and contains all the code you need to draw shapes and control 3D objects. It has a set of functions called
MinecraftDrawing, which allows you to create lines, circles, spheres and other shapes. Because this complicated code is in a separate module it makes it simpler for you to create the code, and it’s easier to understand too. Modules ...