You've mined for diamonds, crafted dozens of tools, and built all sorts of structures - but what if you could program robots to do all of that for you in a fraction of the time?
In Coding with Minecraft, you'll create a virtual robot army with Lua, a programming language used by professional game developers. Step-by-step coding projects will show you how to write programs that automatically dig mines, collect materials, craft items, and build anything that you can imagine. Along the way, you'll explore key computer science concepts like data types, functions, variables, and more.
Learn how to:
- Program robots that make smart decisions with flow control;
- Reuse code so that your robots can farm any crop you want, including wheat, sugar cane, and even cacti!;
- Program a factory that generates infinite building supplies;
- Design an algorithm for creating walls and buildings of any size;
- Code yourself a pickaxe-swinging robotic lumberjack!;
- Create a robot that digs mine shafts with stairs so you can explore safely.
Bonus activities in each chapter will help you take your coding skills to the next level. By the end of the book, you'll understand how powerful coding can be and have plenty of robots at your beck and call.
This open book is licensed under a Creative Commons License (CC BY-NC-SA). Free download in PDF format is not available. You can read Coding with Minecraft book online for free.
Table of Contents
Getting Started with Minecraft and Computercraft
Basic Lua Programming for Turtles
Talking to Your Turtle
Programming Turtles to Dance
Making a Better Dancer
Programming a Robo Lumberjack
Creating Modules to Reuse Your Code
Running an Automated Tree Farm
Building a Cobblestone Generator
Making a Stone Brick Factory
Programming a Robotic Farm
Programming a Staircase Miner
Name ID Reference