Learn valuable programming skills while building your own Minecraft adventure!

If you love playing Minecraft and want to learn how to code and create your own mods, this book was designed just for you. Working within the game itself, you'll learn to set up and run your own local Minecraft server, interact with the game on PC, Mac and Raspberry Pi, and develop Python programming skills that apply way beyond Minecraft. You'll learn how to use coordinates, how to change the player's position, how to create and delete blocks and how to check when a block has been hit.

The adventures aren't limited to the virtual - you'll also learn how to connect Minecraft to a BBC micro:bit so your Minecraft world can sense and control objects in the real world! The companion website gives you access to tutorial videos to make sure you understand the book, starter kits to make setup simple, completed code files, and badges to collect for your accomplishments. Written specifically for young people by professional Minecraft geeks, this fun, easy-to-follow guide helps you expand Minecraft for more exciting adventures, and put your personal stamp on the world you create. Your own Minecraft world will be unlike anyone else's on the planet, and you'll pick up programming skills that will serve you for years to come on other devices and projects. Among other things, you will:

* Write Minecraft programs in Python® on your Mac®, PC or Raspberry Pi®

* Build houses, structures, and make a 3D duplicating machine

* Build intelligent objects and program an alien invasion

* Build huge 2D and 3D structures like spheres and pyramids

* Build a custom game controller using a BBC micro:bit(TM)

* Plan and write a complete interactive arena game

Adventures in Minecraft teaches you how to make your favourite game even better, while you learn to program by customizing your Minecraft journey.



Autorentext

Martin O'Hanlon (Birmingham, UK) describes himself as a professional geek and amateur snowboarder. Martin blogs about technology, Minecraft and Raspberry Pi at stuffaboutco.de.

David Whale (Essex, UK) is a professional software engineer. He regularly volunteers for The Institution of Engineering and Technology, which provides support at many schools, public workshops and tech camps.

Inhalt

Introduction 1

What Is Minecraft? 1

The Virtual World 1

How Did Minecraft Come About? 2

What Is Minecraft Programming? 2

Who Should Read This Book? 3

What You Will Learn 4

What We Assume You Already Know 5

What You Will Need for the Projects 5

A Note for Parents and Teachers 6

Changes Made to the Second Edition 7

How This Book Is Organised 7

The Companion Website 9

Other Sources of Help 9

Conventions 10

Reaching Out 12

Adventure 1 Hello Minecraft World 13

Setting Up Your Raspberry Pi to Program Minecraft 15

Downloading the Starter Kit 16

Starting Minecraft on Your Raspberry Pi 17

Setting Up Your PC or Apple Mac to Program Minecraft 18

Installing the Starter Kit and Python on Your Windows PC 19

Installing the Starter Kit and Python on Your Apple Mac 21

Starting Minecraft on Your Windows PC or Apple Mac 23

Stopping the Minecraft Server 27

Creating a Program 27

Running a Program 30

Stopping a Program 33

Adventure 2 Tracking Your Players as They Move 35

Sensing Your Player's Position 36

Getting Started 37

Showing Your Player's Position 39

Tidying Up Your Position Display 41

Using postToChat to Change Where Your Position Displays 43

Introducing a Game Loop 43

Building the Welcome Home Game 46

Using if Statements to Make a Magic Doormat 46

Checking if Your Player Is at a Particular Location 47

Building a Magic Doormat 49

Writing the Welcome Home Game 49

Using GeoFencing to Charge Rent 53

Working Out the Corner Coordinates of the Field 54

Writing the GeoFence Program 56

Moving Your Player 59

Further Adventures in Tracking Your Player 62

Adventure 3 Building Anything Automatically 65

Creating Blocks 66

Building More Than One Block 68

Using for Loops 69

Building Multiple Blocks with a for Loop 70

Building a Huge Tower with a for Loop 71

Clearing Some Space 73

Using setBlocks to Build Even Faster 73

Reading Input from the Keyboard 74

Building a House 76

Building More Than One House 82

Using Python Functions 82

Building a Street of Houses with a for Loop 86

Adding Random Carpets 87

Generating Random Numbers 88

Laying the Carpets 89

Further Adventures in Building Anything 92

Adventure 4 Interacting with Blocks 95

Finding Out What You Are Standing On 96

Finding Out if Your Feet Are on the Ground 96

Building Magic Bridges 99

Using Python Lists as Magic Memory 102

Experimenting with Lists 102

Building Vanishing Bridges with a Python List 105

Sensing That a Block Has Been Hit 109

Writing a Treasure Hunt Game 112

Writing the Functions and the Main Game Loop 113

Placing Treasure in the Sky 114

Collecting Treasure When It Is Hit 115

Adding a Homing Beacon 116

Adding Your Bridge Builder 117

Further Adventures in Interacting with Blocks 119

Adventure 5 Using Data Files 121

Reading Data from a File 121

Interesting Things You Can Do with Data Files 122

Making a HintGiver 122

Building Mazes from a Data File 126

Understanding CSV Files 127

Building a Maze 128

Building a 3D Block Printer 134

HandCrafting a Small Test Object to 3D Print 134

Writing the 3D Printer 137

Building a 3D Block Scanner 140

Building a Duplicating Machine 144

Writing the Framework ...

Titel
Adventures in Minecraft
EAN
9781119439578
Format
E-Book (pdf)
Hersteller
Digitaler Kopierschutz
Adobe-DRM
Dateigrösse
35.84 MB
Anzahl Seiten
320