A few months ago, when a colleague told me that he wanted to build a Minecraft server in Python and use it to host a Minecraft tournament, I was pretty excited.
This was a big step forward in our careers and the possibilities for us to collaborate.
Unfortunately, the Python version of Minecraft (Mojang) didn’t ship with the Python-enabled server software and I couldn’t use the Python API.
But after trying it out and seeing how easy it was to build it, I finally got around to it.
The code and documentation is pretty straightforward, but it took a lot of trial and error to get it working and get it running smoothly.
If you’ve never tried a Python server before, you may not be able to do this yourself, but I wanted to give it a try and hopefully help you get started.
You can download the Python server software for Mac or Linux from GitHub and install it using Homebrew.
(If you don’t already have Python installed, you can install it with Homebrew.)
If you have the Python interpreter installed on your computer, you’ll need to create a new virtual machine and run the command sudo python manage.py virtualbox to install the Python runtime.
If your machine doesn’t have Python already, you might want to look into the Python development environment for Mac, which is the official Python distribution for OS X. Then, to install Minecraft server software on your machine, follow these steps: Go to the Minecraft site.
The first page on the page is called Server Information, which contains a list of supported OS X versions, the operating system version, and some helpful information.
For example, it says that Minecraft runs on 10.8.1 and Mojang says it runs on Mac OS X 10.7.4.
Go to your Minecraft installation directory and create a folder called “minecraft.”
Create a directory named “minecraft” and put it in your “minecraft folder.”
Then, open a command prompt and type cd ~/minecraft/ .
Make sure the directory exists, but that it’s not already there.
If it’s already there, just copy and paste the following: python manage,pyinstaller.py Install the Python 3.5 library and the Mojang server software.
The Python 3 libraries will be installed, but Mojang is a much more recent version.
You should also create a directory called “dev” in your directory.
Create a folder named “dev”, and put the following in it: python3.5 dev The Python 2 libraries will also be installed but Mojogames are a newer version of the Python 2 library.
You might also want to check out the Python libraries and the Minecraft server, and if you don’snt already have either, you could try downloading the Minecraft source code.
Make sure you also copy the Minecraft version of python.py, python.lib.python, and python.db.python to the dev directory, so they can be loaded at boot time.
Run the Python installer.
Make a note of the Minecraft executable name.
The installer will ask you to provide your username and password, which will be stored in the “bin” directory in your Python installation directory.
If this is not a valid password, the installer will automatically create a password-protected root password.
If the installer doesn’t create a root password, you should verify that it has been created properly by typing the following command: sudo chmod a+x python.exe .
Now you can go ahead and download the Minecraft game, which should be in the game directory: wget http://mcp.mit.edu/downloads/minecraft.zip Now you should see a list called “Downloads.”
The “Download” button is marked “All Downloads.”
Copy the “minecraft.mp” file to the “mcp” directory.
Copy the Minecraft-server.py file to “minecraft/” folder.
Copy and paste these commands into the “python” folder: python -m SimpleHTTPServer -rpml -d mcp.mitserver.org:443 -r -m – -r 0.0.0:443 server virtualization -D -t python -Dpython.version 3.6.1 -s 3.0 -Dfile.ext -s/run.bat /bin/bash -s /usr/bin/python -dpython.python.exe -rserver virtualizationserver.py -tpython.lib -s ./server.bin /usr,/usr/local/bin,/opt/python3/bin -rpython.debug.bin ./server virtualizeserver.sh You can now run the server.py program.
It should be able launch Minecraft, launch the server, log in, and start the game.
The server runs on a localhost machine, but you can also run it from anywhere on the internet.
If everything went well, you shouldn’t see any errors while running the program, and you