The software used for this course is provided as companion to the book Learn to Program with Minecraft. It is recommended that the students purchase the book.
To get things running, you will need:
- Python 3
- Minecraft Python API
- The Minecraft server
Visit the Minecraft homepage to download. If you do not have an account, please email me and I will make sure you are provided with one.
Python 3 Distribution¶
Python 3 is the distribution we will be using. If you have Python 2, it is recommended that you uninstall Python 2 and install Python 3. If you don’t, there will be some inconsitencies that could be devestatingly confusing. Also, Python 3 has a lot of really cool, new features that aren’t in Python 2.
There are several ways to get Python. I personally recommend the Anaconda distribution. It has a bunch of things packaged with it above and beyond Python that make it useful. Anaconda comes with the Spyder editor. It is a decent editor, but I would recommend:
You should have both Minecraft and Python installed at this point. You need to set Java up in order to run the server.
If you are on Windows:
- Click the Start Menu (or press the Windows key)
- Type “cmd” to find the program called cmd. Open this.
- This is the command prompt. It is also called a terminal or console.
- Type java -version at the prompt
- If you see an output describing the version of Java, you already have it and can continue to the next section.
- If you don’t, or it can’t find java, then go to here: http://www.java.com/en/download/
- Click Free Java Download. Then click Agree and Start
- When it is finished downloading, install this.
- IMPORTANT: If it asks you to install extra things or set Yahoo! as your homepage, click no.
- This is the annoying feature about installed Java.
- Retry steps 1-3. If they succeed, move on. If they don’t, email me.
Minecraft Python API and Minecraft Spigot server¶
An API is an interface. We will use it as a library that lets us communicate with the Minecraft server. We will not be able to edit the server in any way, but instead, just tell it instructions.
We will be using the Spigot server because it allows for the API to talk to it. Standard Minecraft does not.
To install both of these:
- Go to https://www.nostarch.com/pythonwithminecraft/
- Download the MinecraftTools.zip for your operating system.
- When it has finished downloading, you can open it.
- a zip file is known as a compressed file
- it allows you to compress a set of files to make them smaller for downloading
- all operating systems let you open these files
- Important Although it looks like you have a folder, the contents of the Zip file are not a folder
- Create a folder somewhere convenient and name it MinecraftTools.
- Inside the Zip file, you can click “Extract all” or similar button.
- Extract it to your MinecraftTools folder.
- Go to the folder and double click the Install_API file.
- Now, you can run the server.
- There is a file called Start_Server. Running this will start the server.
- If you have any trouble, email me.