CONTENTS AT A GLANCE 1 Introduction... 1 2 Basic Redstone... 11 3 Redstone Logic Gates... 31 4 Advanced Redstone... 49 5 Miscellaneous Redstone... 67 6 Server Hosting and Tools... 83 7 qcraft... 101 8 ComputerCraft... 117 9 Modding with Forge... 139 10 Example Mod: Thorium... 151 11 More Modding Examples... 173 A Resources... 193 A Index... 195 v
CONTENTS Acknowledgments... Introduction... xiii xv 1 Introduction... 1 What Is Minecraft?... 1 Minecraft Versions... 2 Getting Started... 3 Basic Crafting... 3 Forging... 4 Creative Mode... 5 Cheats... 7 Redstone... 7 Using Mods... 7 Making Mods... 8 Installing the Example World... 8 Summary... 9 2 Basic Redstone... 11 The Very Basics... 11 Obtaining Redstone... 11 Coordinates in Minecraft... 12 Placing Redstone... 12 Redstone Power... 13 Levers... 13 Buttons... 14 Pressure Plates... 15 Tripwires... 17 Redstone Blocks... 18 The Redstone Tick Rate... 18 vii
viii Contents Torches... 18 Redstone Lamps... 21 Redstone Repeaters... 22 Comparators... 24 Pistons... 25 Making a Door... 27 Hoppers, Dispensers, and Droppers... 29 Hoppers... 29 Dispensers... 29 Droppers... 30 Summary... 30 3 Redstone Logic Gates... 31 Basic Logic Gates... 31 Inverters... 31 AND Gates... 32 De Morgan s Law... 33 Or Gates... 34 XOR Gates... 36 Logic Gate Example... 37 Clocks... 38 RS NOR Latches... 40 Monostables... 42 T-Flip-Flops... 42 Logic Theory... 44 Binary... 44 Logic Diagrams... 45 Summary... 48 4 Advanced Redstone... 49 Block Updater Detector Switches... 49 Making Piston Doors... 50 Building a 2 2 Door... 50 Building a 2 2 Flush Door... 52
Contents ix Block Swappers............................... 55 The Very Compact Block Swapper... 55 The Flush Block Swapper... 56 Piston-Tape Memory... 58 Displays... 62 Summary... 65 5 Miscellaneous Redstone... 67 Rails and Minecarts... 67 Rails... 68 Minecarts... 69 A Minecart Example... 72 Liquid Physics... 72 Lava... 73 Water... 74 Hoppers... 75 Command Blocks... 76 Player Traps... 76 Command Block Player Trap... 77 A Redstone Player Trap... 78 TNT Cannons... 80 Summary... 81 6 Server Hosting and Tools... 83 Server Hosting... 83 Server Hosting on a LAN... 84 Server Hosting Using Hamachi... 85 Server Hosting Using Port Forwarding... 88 Server Properties Options... 92 Renting Servers... 93 MCEdit... 93 Minecraft, Python, and Pi... 96 Installing Minecraft on the Raspberry Pi... 96 Running Minecraft... 96 Connect to the Pi from a Second Computer... 97 Summary... 99
x Contents 7 qcraft... 101 Getting qcraft... 101 Installing the Example World... 102 Quantum Dust... 103 Essence of Observation... 103 Essence of Superposition... 106 Essence of Entanglement... 107 Automated Observers... 108 Quantum Computers... 110 Quantum Portals... 113 Summary... 115 8 ComputerCraft... 117 Installing the Example World... 117 A Computer Block... 118 Getting Started... 119 Example Code... 122 A Light Chaser Example... 124 Computer Networks... 126 Disk Drives... 128 Monitors... 131 Clock Example... 133 Turtles... 135 Summary... 138 9 Modding with Forge... 139 Overview of the Modding Process... 139 Preparing Your Computer... 140 Install Minecraft... 140 Installing Java... 140 Adding Java to Your Path... 141 Installing Eclipse............................ 142 Installing Forge... 144 Setting Up Eclipse... 145
Contents xi A Quick Tour of Eclipse... 146 Java Basics... 146 Packages... 147 Classes................................... 147 Member Variables... 148 Methods... 148 Classes and Instances... 149 Inheritance... 149 Public and Private... 149 Naming Conventions... 150 Summary... 150 10 Example Mod: Thorium... 151 Setting Up the Project... 151 Creating a Project... 152 Creating a Package... 153 Linking the Projects... 153 Basic Block Ore... 154 Creating the ThoriumOreBlock Class... 154 Packages and Eclipse... 156 Creating the Thorium Mod Class... 157 Creating the mcmod.info File... 158 First Run... 159 Making the Mod Usable... 160 Adding a Custom Texture... 161 Creating a Texture Image File... 161 Localized Names... 162 Spawning Ore Blocks... 164 Mining Thorium... 168 Forging Thorium Ore into Thorium... 168 Creating a New Block... 169 Adding a Crafting Recipe... 170 Making Thorium Glow... 171 Summary... 172
xii Contents 11 More Modding Examples... 173 Releasing a Mod... 173 Building a JAR File... 173 Installing a Mod... 175 More on Modding... 179 Item Example: Cooked Bone... 180 Item Example: Hardened Diamond... 181 Item Example: Obsidian Axe... 182 Armor Example... 183 Armor Item Classes... 184 Armor Texture Files... 185 Adding Armor to the Mod File... 187 Armor Recipes... 187 Graphical User Interfaces (GUIs)... 187 Changes to the Mod Class... 188 The BlockSwitchableLight Class... 189 The SmallThingsGUI Class... 190 Summary... 191 A Resources... 193 A Index... 195