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 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'll 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, 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 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 what happens ...