Skip to content

BridgerSilk/PyBlock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌍 PyBlock

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.

Minecraft Version Region Format Performance


💡 About

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.


✨ Key Features

  • ✅ Write Minecraft Bukkit API logic in Python
  • 📦 Reload scripts with a single command while the server is running
  • 🔧 Built-in utility functions like broadcast() and cancel_event()
  • 🧠 Thread-local event context handling for safe execution
  • 📁 Simple file-based script loading system

📜 Example Scripts

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.


📚 Documentation

Full documentation is available here


📂 Scripts Folder

Place your Python .py scripts inside the plugins/PyBlock/scripts/ folder. PyBlock will load and run them automatically on startup or when reloaded.


📌 Requirements

  • Minecraft Server (Spigot, Paper or a fork of these)
  • Java 17+

🛠️ Installation

  1. Download the latest PyBlock release from the Releases tab
  2. Drop it into your plugins folder
  3. Start your server once to generate folders
  4. Add your .py scripts into the scripts/ directory
  5. Run /pyblock reload (if applicable) or restart the server to apply changes

🙌 Created by BridgerSilk

Have fun scripting! 🐍

About

Create Minecraft Plugins with Python.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published