9781118946916-co0701.tif

ONE OF THE great things about programming in Minecraft is that as well as 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 will learn how to use the minecraftstuff module to create 2D lines and shapes which when combined with a little maths will allow you to program a clock so big you can stand on its hands as they go round (see Figure 7-1). Once you have mastered creating 2D shapes, you will then learn how to combine them together to create enormous 3D structures in seconds.

9781118946916-fg0701.tif

FIGURE 7-1 A massive Minecraft clock

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 ...

Get Adventures in Minecraft now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.