- Saved searches
- Use saved searches to filter your results more quickly
- sjlawson/mc_python_spigot_linux
- Name already in use
- Sign In Required
- Launching GitHub Desktop
- Launching GitHub Desktop
- Launching Xcode
- Launching Visual Studio Code
- Latest commit
- Git stats
- Files
- README.md
- About
- Installing Minecraft¶
- Minecraft¶
- Python 3 Distribution¶
- Java¶
- Minecraft Python API and Minecraft Spigot server¶
- Saved searches
- Use saved searches to filter your results more quickly
- BlueJayADAL/MinecraftPython
- Name already in use
- Sign In Required
- Launching GitHub Desktop
- Launching GitHub Desktop
- Launching Xcode
- Launching Visual Studio Code
- Latest commit
- Git stats
- Files
- README.md
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
instructions for getting Spigot Minecraft server on Linux with py3minepi as done in Craig Richardson’s «Learn to Program with Minecraft»
sjlawson/mc_python_spigot_linux
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
Setting up minecraft for most recent version with Spigot and python api
Python3.6 or newer with venv module Java 8 (JRE and JDK — openjdk is great)
Build for specific version of MC: java -jar BuildTools.jar —rev 1.14.4
Run server: java -Xms512M -Xmx1024M -XX:MaxPermSize=128M -jar spigot-1.14.4.jar
(you may be required to accept the EULA by editing the text file it tells you about)
After the server has run successfuly, enter a stop command
This package is needed to setup the correct API routes for python Install maven:
Build the raspberry juice package:
git clone https://github.com/zhuowei/RaspberryJuice cd RaspberryJuice mvn package
Copy the produced file to the Spigot plugins directory: cp target/raspberryjuice-1.11.jar ~/mc_python/plugins/
Setup Python virtual environment and get py3minepi
- Create a working directory for your python files
- Get Mac minecraft tools (they say for Mac, but all you need is the python package): https://sourceforge.net/projects/program-with-minecraft-mac/
- Extract the download and copy the folder, py3minepi-master to your working directory
- in your working directory, create a python virtualenv with: python3.7 -m venv py
- activate the virtualenv: source py/bin/activate
- install the py3minepi package: pip install ./py3minepi-master
- start the server: (you may need to fill in a full path for spigot-n.nn.n.jar) java -Xms512M -Xmx1024M -XX:MaxPermSize=128M -jar spigot-1.14.4.jar
- start minecraft and login to the localhost minecraft server
- get somewhere in the game where you wont immediately die.
- alt-tab out to the terminal
- With the python virtual environment activated source py/bin/activate start a python console session by simply typing python
- Import and enter a test command:
>>> from mcpi.minecraft import Minecraft >>> mc = Minecraft.create() >>> mc.player.getTilePos() Vec3(117,2,-63)
It’s important to note that this vector is not your absolute position in the world, but your position relative to your spawn point.
About
instructions for getting Spigot Minecraft server on Linux with py3minepi as done in Craig Richardson’s «Learn to Program with Minecraft»
Installing Minecraft¶
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:
- Minecraft
- Python 3
- Java
- Minecraft Python API
- The Minecraft server
Minecraft¶
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:
- PyCharm.
- If you download PyCharm, make sure you download the Community Edition.
- This is my personal favorite. It is lightweight and has many extensions.
- However, it does not run or debug Python files as easily as PyCharm.
- Very similar to Sublime
Java¶
You should have both Minecraft and Python installed at this point. You need to set Java up in order to run the server.
- Click the Start Menu (or press the Windows key)
- Type “cmd” to find the program called cmd. Open this.
- 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.
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.
- 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.
© Copyright 2016, Brian McMahan. Revision 94fef083 .
Versions latest Downloads pdf htmlzip epub On Read the Docs Project Home Builds Free document hosting provided by Read the Docs.
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
BlueJayADAL/MinecraftPython
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
This tutorial works with Minecraft Java Edition 1.16.5
Install the spigot server:
- Createa an empty directory on the server machine named MinecraftPythonServer in the home directory, then navigate the the directory by using:
- Download the spigot server from GetBukkit: https://getbukkit.org/download/spigot. Downlaod the right version of your choice and put the jar file in the above created folder.
- Extract and install the server with the downloaded jar file: spigot-1.16.5.jar by using the command:
java -Xms1024M -Xmx1024M -jar ./spigot-1.16.5.jar nogui
- The command above should generate an error for the first time of installation due to not accepting the user agreement EULA.
- Go to the installation directory and find the eula.txt file. Change the accept=false property from false to true . Save and exit.
- Enable firewall on the server’s port:
java -Xms1024M -Xmx1024M -jar ./spigot-1.16.5.jar nogui
- Once the server is booted up, create a world by following the steps below.
- Open Minecraft game —> Play (ensure you have a paid account) —> Multiplayer —> Add Server —> Name: AdalMinecraftPython, IP: localhost:25565 —> done.
- Double click into the server to ensure everything is running okay, then exit.
- Stop the server by type the stop command on the commandline.
Download the Install the RaspberryJuice Plugin to enable Python Interfacing:
- Download the plugin from https://www.spigotmc.org/resources/raspberryjuice.22724/.
- Save the file to the plugins folder int the installation direcotry: ~/MinecraftPythonServer/plugins/raspberryjuice-1.12.1.jar
- Re-start the server. This time the raspberryjuice plugin will be found and applied.
java -Xms1024M -Xmx1024M -jar ./spigot-1.16.5.jar nogui
Create a World on the Client machine:
- Ensure minecraft is installed on your own client machine (different from server).
- Get into multiplayer mode and «add server». Use name: AdalMinecraftPython, IP: 10.4.10.8:25565
- Double click to enter the world.
Install the Minecraft Python API mcpi tool on your Client machine:
import mcpi.minecraft as minecraft import mcpi.block as block mc = minecraft.Minecraft.create("10.4.10.8", 4711) # 10.4.10.8 is the IP of the server, 4711 is the socket port mc.postToChat("Etown CS121!") mc.getPlayerEntityIds()