The book "Minecraft. Program your world in Python. 2nd international edition »

    We published a reissue of a book addressed to boys and girls who love to play Minecraft at the age of 11-15 years.

    image

    Do you like to play Minecraft? Do you like to learn new things and invent something that did not exist before? Do you want to build your own virtual world that all your friends will envy? Can Minecraft be combined with programming? Need to! Now you will not only play and live in the wonderful world of Minecraft, but also learn how to program in Python. Simple instructions and tips will help bring your ideas to life, build a house and a 3D photocopier, find treasures, and even start giant working hours in your garden. Read this book and become a real demiurge who is able to create his own world and protect it from aliens. Now in Python 3!

    Who is this book for?


    The book is written for boys and girls who love to play Minecraft and want to learn programming, with the help of new knowledge to achieve more. In general, the books of the “Minecraft ....” series are addressed to readers aged 11–15 years, but some adventures in the final may be interesting to older readers as well. In addition, the first chapters of the book experienced very young fans of Minecraft at the age of eight years.

    Perhaps you have already gained serious gaming experience, but you feel annoyed at how much time you have to spend on creating new facilities. Or you are looking for ways to expand the game with additional logic and automation features. Whatever your goals, this book will be a guide to traveling in programming for Minecraft, and every adventure seeker knows that a guide is the most valuable load in a backpack. You start your journey with a simple, for example, sending messages to Minecraft chat, then learn the basics of programming for Minecraft in Python, and finally learn how to use new skills to create your own games inside Minecraft. By the end of the journey you will receive knowledge and skills sufficient to become a pioneer in programming for Minecraft!

    What do you learn


    You will learn about the many sides of Minecraft and how to influence its behavior with Python programs. Unlock the mystery of addressing blocks in a three-dimensional world using coordinates. Learn how to locate a character, create and delete blocks in Minecraft, and how to determine which block is selected by the player.

    You will learn how to write programs in the Python language: from the simplest ones, such as “Hello, Minecraft World!”, To complex, interacting with huge three-dimensional objects, which, thanks to new programming skills in Python, are easy to stamp. You will also learn how to set up and run your own local Minecraft server on a PC.

    Using the free module MinecraftStuff, which is part of the library in Python, you can create two- and three-dimensional objects from blocks, draw lines and polygons, and also display text.

    Note to parents and teachers


    We have divided the book into several separate adventures, which can be considered independent projects. Each of them is devoted to one feature of programming for Minecraft. Familiarity with the language of Python will proceed gradually, from simple to complex. The first adventures are focused exclusively on beginners, and the latter cover more complex sections of the Python language and make the reader strain his abilities.

    Each Adventure presents a separate practical project with step-by-step instructions (in which readers will be able to mark completed items with check marks), drawn up in a style that resembles the style of comments in program listings. Detailed descriptions are given in the “Dive into the Code” box, which students can read later, so as not to be distracted from entering and testing programs.

    Each Adventure may require more than one lesson, but they are all divided into sections that can be used as topics for individual lessons or lessons.
    The syntax of the Python language provides for the design of listings of programs with indents to the left, to highlight the structure of the code - it is case-sensitive. Adults' advice on the correct design of indents and character registers, which will help them to avoid mistakes when typing programs, can be useful for young readers. All programs can be downloaded from the supporting website. Therefore, if any problems arise in the program, compare your version with ours and see where you made a mistake.

    Changes to the second edition


    In the second edition, we retained the content and the same light narrative style and made some minor improvements and corrections:

    • Downloadable starter kits were a bit simplified. All coordinates are now consistently reported to the Python program as absolute, that is, real coordinates inside Minecraft (and not relative to the spawn point, as it was before). This makes the mathematics associated with the placement of objects in Minecraft, much more understandable for children. And due to this, sometimes large numbers are displayed. The coordinates on the screen now match the coordinates reported by the Python program you are writing.
    • To make the book modern and consistent with what is used in schools, all programs are now written in the latest version of Python 3, which we recommend downloading to our readers in Adventure 1. The only difference that can be seen in our programs is using input () instead raw_ input () (in this regard, Python 3 works a little differently than Python 2).
    • Martin's free MinecraftStuff module has been updated to simplify some functions, and this has reduced the amount of code you need to enter the programs in Adventures 6 and 7, and also allowed you to enable a new feature: Minecraft Turtle! This is a fully controlled block in Minecraft that can move in three dimensions and allows readers to draw complex shapes very easily and quickly. It also goes well with training programs that regularly implement programming concepts using a programmable turtle.

    On the structure of the book


    Each chapter in the book is a separate adventure, teaching new skills and concepts in the process of programming and testing projects. The book is organized so that each adventure corresponds to a separate project. Although, perhaps, it will be easier for someone to master them in order and get acquainted with new programming concepts gradually.

    It is very important that you read Adventure 1 before you do anything else. It describes how to download and install everything you need, and make sure that everything is working properly. In this adventure, we will list the main steps that will have to be performed in the following adventures, and we will remind you of them during the first adventures.

    The first three adventures are written for those who know little or know nothing about programming at all. We will explain all the terms and concepts as we meet them. In Adventures 2, 3 and 4, the key elements of any good Minecraft game are considered. Among them: the definition of events taking place in the world of Minecraft; performing simple calculations and creating programs that react differently, for example, sending chat messages or automatically creating blocks. These three key concepts - definition, calculation and response - we will use throughout the book to create large and exciting Minecraft programs.

    Adventures 5 and 6 are based on what you learned in previous adventures, and contain larger programs that are developed and tested in stages. Adventure 5 discusses methods that allow you to contribute large amounts of data from data files in order to save and duplicate large structures using a three-dimensional copy machine.

    Adventures 6 and 7 introduce MinecraftStuff module, which allows using blocks to create lines, circles and other two-dimensional figures, as well as some fantastic three-dimensional spheres and pyramids. They can be the basis for the construction of giant structures, which are very difficult to create manually. Adventure 7 shows how to give moving objects individual features to make their movements more or less reasonable. Having mastered these techniques, you will be able to write exciting "games within the game," which will surely amaze your friends.

    Excerpt Alien invasion


    Aliens are planning to invade the world of Minecraft. The spacecraft is diving from above directly at a character who is in mortal danger: aliens are hostile and will not calm down until they achieve their goal.

    In the next program, you will use MinecraftShape and programming techniques already used to create a block-friend for building an alien spacecraft (Fig. 7.5) that will float in the air, chasing the character and trying to get over it. When this happens, he teleports the character inside.

    The spacecraft is created using MinecraftShape, like a wooden horse in the previous program; each block will have its own relative coordinates and type. In fig. 7.6 shows the coordinates of the blocks (when viewed from the side and above).

    image

    image

    image

    image

    image

    image

    »More information about the book is available on the publisher's website
    » Table of Contents
    » Excerpt

    For Habrozhiteley 20% discount coupon - Minecraft

    Also popular now: