These instructions should work on any Ubuntu-based OS, but have only been tested on GalliumOS.
Copy and paste the following line into a terminal and press enter to install all the dependencies (you might already have some installed):
sudo apt update
sudo apt install python-software-properties python3 python3-pip idle3 git
sudo apt install openjdk-8-jre-headless openjdk-8-jdk maven
sudo add-apt-repository ppa:flexiondotorg/minecraft
sudo apt update
sudo apt install minecraft
At this point, you can run the "minecraft" command to see if you can run and play the game.
Spigot is a popular minecraft server that allows modding. RaspberryJuice is a Spigot plugin that allows modding with Python.
Make note of your current minecraft version (you can check it in the game launcher) and use it for the --rev
argument when building Spigot.
mkdir ~/spigot
cd ~/spigot
wget "https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar"
git config --global --unset core.autocrlf
java -jar BuildTools.jar --rev 1.12.2
This will take a while to build.
Download and build RaspberryJuice and install it into the spigot plugins dir:
git clone https://github.com/zhuowei/RaspberryJuice ~/spigot/RaspberryJuice
cd ~/spigot/RaspberryJuice
mvn package
mkdir ~/spigot/plugins
cp ~/spigot/RaspberryJuice/jars/raspberryjuice-1.11.jar ~/spigot/plugins/
echo "eula=true" > ~/spigot/eula.txt
Create the following startup shell script in ~/spigot/start.sh
#!/bin/sh
java -Xms512M -Xmx1024M -jar /home/spigot/spigot-1.12.2.jar
Install the latest version of py3minepi from github:
sudo pip3 install git+https://github.com/py3minepi/py3minepi/
- Start your spigot server in a terminal window:
~/spigot/start.sh
- Start the minecraft launcher, log in, and press Play.
- Select "Multiplayer"
- Select "Direct Connect"
- Type in "localhost" and Select "Join Server"
Then, run idle3
(python shell) and test out a simple "Hello World"
message:
>>> from mcpi.minecraft import Minecraft
>>> mc = Minecraft.create()
>>> mc.postToChat('Hello World!')
Quickly switch back to your game, and you should see "Hello World!" pop up in a chat message.
You need to set online-mode=false in Spigot's server.properties file to avoid pinging the Mojang login servers.