Minecraft is great for learning Python.  Here’s how to get the client going on Debian.

I’m using spigotMC for the Minecraft server.

First install java, git and tar

# apt-get install git openjdk-7-jre-headless tar

Download BuildTools.jar from https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar to /home/username/spigot/.

Then run

$ git config --global --unset core.autocrlf


$ java -jar BuildTools.jar

Grab some coffee while it builds and then create a startup script for spigot.jar in the same directory.

java -Xms512M -Xmx1G -XX:MaxPermSize=128M -XX:+UseConcMarkSweepGC -jar spigot-1.9.2.jar

The .jar version will probably be different.  Change eula.txt to true, and run the script above.  This will start the server and create the plugins directory.

Download RaspberryJuice and place it in the plugins folder in the directory created above.  http://dev.bukkit.org/bukkit-mods/raspberryjuice/files/

Run the server and connect the Minecraft client to localhost under multiplayer.

Install pip for python3 on your Debian host.

# apt-get install python3-pip

Download and install the py3minepi: https://github.com/py3minepi/py3minepi

# python3 -m pip install py3minepi-master.zip

Run python and test out some python commands.

$ python3
Python 3.5.1+ (default, Jan 13 2016, 15:09:18) 
[GCC 5.3.1 20160101] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from mcpi.minecraft import Minecraft
>>> mc = Minecraft.create()
>>> mc.postToChat("hello world")



1 Comment

Matt Clemons · September 7, 2016 at 7:57 pm

should be in ~/spigot/plugins

Leave a Reply

Your email address will not be published. Required fields are marked *