Projects / PyMC
py

PyMC

Paper plugin · Java, Python 3.0.0 alpha

Commands and events for a Minecraft Paper server, written in real Python instead of Skript.

About

Scripts are plain Python files in the server's plugin folder. A script declares a command or an event, and the rest of the file runs when someone uses the command or the event happens.

What it does

  • Command patterns like /gift {player} {item} [amount] with required and optional arguments
  • Events such as join, break and place, like Skript's on join:
  • /pymc reload <script> checks the script and tells you exactly which line is wrong
  • Runs with the machine's Python, or with GraalPy inside the server's own JVM when Python is not installed

Requirements

  • Paper 1.21 or newer
  • Java 21 or newer
  • Optional: Python 3.9+ on the host. Without it, GraalPy is downloaded once on first start (about 150 MB)

Install

  1. Drop PyMC-3.0.0-alpha.jar into plugins/ of your Paper server and start it.
  2. Put scripts into plugins/PyMC/scripts/, then run /pymc reload.
plugins/PyMC/scripts/gift.py
from pymc import mcmod, mccommand

mcmod.triggerCommand("/gift {player} {item} [amount]")

mccommand.execute.console(f"/give {player} {item} {amount or 1}")
mccommand.broadcast(f"&6{mcmod.sender} gave {player} some {item}")

PyMC is in alpha, so things can still change.