O'Reilly logo

Adventures in Minecraft by Martin O'Hanlon, David Whale

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

9781118946916-co0201.tif

WHEN YOU PLAY Minecraft, you are playing a game that other people have designed for you. The Minecraft world is fun, but it’s even more fun if you can make it do the things that you want it to do. When writing Minecraft programs in Python, you now have a complete programming environment at your fingertips, and you can invent and program anything you can possibly imagine. This adventure introduces you to some of the fun things you can create using Minecraft and the programming language Python.

A really fun thing to do when programming Minecraft is to create a game within a game. Minecraft is the “world”, and your program will make this world behave in new ways. You will find that most Minecraft programs have three things that make them fun and exciting: sensing something about the world, such as the player position; calculating something new, such as a score; and behaving in some way, such as moving your player to a new location.

In this adventure you will learn how to sense your player’s position and make different things happen in the game as your player moves. In the welcome home game you build a magic doormat that greets you when you walk on it. We’ll introduce a technique called geo-fencing using a real Minecraft fence, and your game will challenge you and your friends to compete to collect objects in the fastest time possible. Finally you will learn how to move your player ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required