9781118946916-co0601.tif

IT’S WHEN YOU can start to process large amounts of data that computer programming gets really exciting. Your program then becomes a set of rules that govern how that data is read, processed and visually represented—the data becomes the really important part.

In this adventure, you will first look at how to create text files that define mazes. The mazes will then be automatically built in the Minecraft world for you and your friends to solve; you will wonder how such a small Python program can build something so big in the Minecraft world.

You are then going to develop this simple idea into a complete virtual 3D scanning and printing facility called the duplicator room. Anything you build inside the duplicator room can be saved to a file and recalled later, and teleported to any location in your Minecraft world, and even loaded into Minecraft worlds on other computers! You will be able to build up your own library of objects and build them in Minecraft so quickly that your friends will all want duplicating machines of their own!

Reading Data from a File

Computer programs are generally quite unintelligent—they repeatedly follow instructions that you give them. If you don’t change any input to your program, it will do exactly the same thing every time you run it. The Minecraft programs you have been making have been quite interactive because they change what they do depending on ...

Get Adventures in Minecraft now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.