Schweitzer Fachinformationen
Wenn es um professionelles Wissen geht, ist Schweitzer Fachinformationen wegweisend. Kunden aus Recht und Beratung sowie Unternehmen, öffentliche Verwaltungen und Bibliotheken erhalten komplette Lösungen zum Beschaffen, Verwalten und Nutzen von digitalen und gedruckten Medien.
THIS BOOK IS going to help you learn how to write programs or mods that interact with your Minecraft world, allowing you to do some very exciting things. You use a programming language called Python to do it. This way of controlling the Minecraft world from a Python program was first created for Minecraft: Pi Edition on the Raspberry Pi. If you don't have a Raspberry Pi but have Minecraft for Windows or Apple Mac instead, that's okay; you just need to do some extra work on the setup before you get started, which this adventure shows you how to do.
Python is the programming language used in this book.
This book is full of adventures that teach you how to write programs for the Minecraft game. It's packed with all sorts of things you can do with Minecraft to entertain your friends and make the game even more fun to play. You will discover some pretty flashy ways to move your player around, and before long you'll be finding it easy to build whole cities and Minecraft creations that have never been seen before.
The Python programming language comes with a code editor called IDLE, which you will use to create, edit and run the programs you create in these adventures.
The Python programming language is used throughout the world in business and education. It is extremely powerful but also easy to learn. You can find out more about Python at www.python.org/.
www.python.org/
When computer programmers learn a new programming language or a new way of doing something, they always start by writing a "hello world" program. This is a really simple program that displays "hello world" on the screen, to make sure everything is installed and working properly.
In this first adventure, you set up your computer to allow you to write a program that displays the text "Hello Minecraft World" on the Minecraft chat (see Figure 1-1).
FIGURE 1-1 Hello Minecraft World
To do the Minecraft programming in this book, you need one of these three types of computer: a PC running Microsoft Windows; an Apple Mac running macOS X; or a Raspberry Pi running Raspbian with Pixel. The way you set up your computer depends on which sort of computer you have but, once you have set it up, you program Minecraft in exactly the same way on all of them. To make it easier for you to set up your computer, you can download a starter kit from https://adventuresinminecraft.github.io. The starter kits have been tested to make sure all the adventures in this book work properly.
https://adventuresinminecraft.github.io
You'll see that your starter kit contains a README file, which you should have a look at. It describes what the kit contains and how it was created; you could use this information to set up your own computer from scratch, although this is not recommended. You'll get a lot more out of it by following the instructions in this book.
README
Make sure you follow the instructions for your type of computer, either "Setting Up Your Raspberry Pi for Programming Minecraft" or "Setting Up Your PC or Apple Mac for Programming Minecraft".
It's essential that you to set up your computer correctly; otherwise you could get yourself into quite a muddle. So please make sure that you follow the instructions very carefully!
If you are using a Raspberry Pi, Minecraft is installed already; you just need to download the Raspberry Pi starter kit. Everything you need to complete Adventures in Minecraft is in a folder called MyAdventures. You also will save your Minecraft programs in this folder.
MyAdventures
To see a video of how to set up your Raspberry Pi, visit the companion website at http://www.wiley.com/go/adventuresinminecraft2e.
http://www.wiley.com/go/adventuresinminecraft2e
The Raspberry Pi's graphical user interface (GUI), known as Pixel, is used throughout Adventures in Minecraft. The GUI is installed on Raspbian, but depending on how you have set up your Raspberry Pi, it may not load the GUI when it boots up. You may instead start with a login and command prompt.
If your Raspberry Pi is set up to start at a command prompt, you need to log in, type startx and then press Enter to load the GUI when the command prompt appears.
startx
Start Adventures in Minecraft with a new installation of Raspbian so you can be sure that your Raspberry Pi is set up correctly. Visit www.raspberrypi.org/help/ for information on setting up your Raspberry Pi and installing Raspbian.
www.raspberrypi.org/help/
Once your Raspberry Pi has booted up and the GUI has started, you can download the starter kit for Raspberry Pi by following these steps:
cd ~ cd Desktop
git clone https://github.com/AdventuresInMinecraft/AdventuresInMinecraft-Pi
https://github.com/AdventuresInMinecraft/AdventuresInMinecraft-Pi
FIGURE 1-2 Download the Raspberry Pi starter kit.
Visit https://adventuresinminecraft.github.io as there may be future updates and help available.
After you have downloaded the starter kit, you can run the game and have a go before moving on to creating your first program.
In future adventures, the instructions tell you to start Minecraft. If you ever need a reminder of how to start Minecraft on the Raspberry Pi, just refer to this section.
To start Minecraft, follow these steps:
FIGURE 1-3 Start Minecraft and create a new world.
The main menu has two options: Start Game to build a new or enter an existing Minecraft world and Join Game to join another player's world. (See Figure 1-3.)
Once your Raspberry Pi is set up and you have Minecraft running, you can skip the next section (unless you want to set up Minecraft on a PC or Mac as well as on your Raspberry Pi) and go straight to the "Creating a Program" section later in this adventure.
Whether you are using a Windows PC or a Mac, you need to make sure Minecraft is installed and working on your computer. If you don't have a copy of Minecraft and a user ID to play it, visit www.minecraft.net to purchase the game. If you encounter any problems installing, running or playing Minecraft, help is on hand; just visit https://help.mojang.com.
www.minecraft.net
https://help.mojang.com
To program the full version of Minecraft on the PC and Apple Mac, you need to use a Minecraft server and the RaspberryJuice plugin, which is included in the Starter Kit you download later in this section
RaspberryJuice is a Minecraft server plugin that allows you to write programs to change Minecraft in the same way as you can on the Raspberry Pi. A plugin is a program that runs inside the Minecraft server and lets you modify (mod) Minecraft.
You need to download the Python programming language and install it on your computer. Throughout Adventures in Minecraft you use Python version 3. The programs within Adventures in Minecraft have all been tested to work with Python version 3.6.1. Although it is not essential that you use this version, it is recommended and you must use Python 3.something.
If you want to find out more about Python, visit www.python.org. You can download Python from www.python.org/downloads, and the Python Wiki, wiki.python.org, contains lots of information, tutorials and links to Python community websites.
www.python.org
www.python.org/downloads
wiki.python.org
Setting up your Windows PC or Apple Mac to create your first Minecraft program requires three steps:
To see a video of how to set up your Windows PC or Apple Mac, visit the companion website at...
Dateiformat: ePUBKopierschutz: Adobe-DRM (Digital Rights Management)
Systemvoraussetzungen:
Das Dateiformat ePUB ist sehr gut für Romane und Sachbücher geeignet – also für „fließenden” Text ohne komplexes Layout. Bei E-Readern oder Smartphones passt sich der Zeilen- und Seitenumbruch automatisch den kleinen Displays an. Mit Adobe-DRM wird hier ein „harter” Kopierschutz verwendet. Wenn die notwendigen Voraussetzungen nicht vorliegen, können Sie das E-Book leider nicht öffnen. Daher müssen Sie bereits vor dem Download Ihre Lese-Hardware vorbereiten.Bitte beachten Sie: Wir empfehlen Ihnen unbedingt nach Installation der Lese-Software diese mit Ihrer persönlichen Adobe-ID zu autorisieren!
Weitere Informationen finden Sie in unserer E-Book Hilfe.