PyBlock is a powerful plugin for Minecraft servers that lets you write server-side logic using Python instead of Java during runtime. Built with Jython, it provides a flexible and scriptable way to control in-game behavior with ease.
PyBlock brings Python scripting to Minecraft servers. Want to cancel a block break event? Broadcast a message when a player joins or even create minigames? You can do it all in just a few lines of Python, without ever touching Java.
PyBlock is ideal for server owners and developers who want the flexibility of plugins, without compiling Java code or restarting the server for every change.
- ✅ Write Minecraft Bukkit API logic in Python
- 📦 Reload scripts with a single command while the server is running
- 🔧 Built-in utility functions like
broadcast()andcancel_event() - 🧠 Thread-local event context handling for safe execution
- 📁 Simple file-based script loading system
Here's how easy it is to use PyBlock:
# prevent blocks from being broken
# if you open the scripts folder with an IDE you can import features from pyblock to make pylance recognize them (doesn't affect how the script runs)
from pyblock import cancel_event, broadcast
def event_block_break(event):
broadcast(event.get("player") + " tried braking a " + event.get("block"))
cancel_event(event.get("event")) # Prevent the block from breaking# greet players on server join
# if you open the scripts folder with an IDE you can import features from pyblock to make pylance recognize them (doesn't affect how the script runs)
from pyblock import broadcast
def event_player_join(event):
broadcast("Welcome to the server, " + event.get("player") + "!")These Python functions get automatically called when the respective events (e.g. BlockBreakEvent, PlayerJoinEvent) are fired.
Full documentation is available here
Place your Python .py scripts inside the plugins/PyBlock/scripts/ folder. PyBlock will load and run them automatically on startup or when reloaded.
- Minecraft Server (Spigot, Paper or a fork of these)
- Java 17+
- Download the latest PyBlock release from the Releases tab
- Drop it into your
pluginsfolder - Start your server once to generate folders
- Add your
.pyscripts into thescripts/directory - Run
/pyblock reload(if applicable) or restart the server to apply changes
🙌 Created by BridgerSilk
Have fun scripting! 🐍