Pumpkin plugin API for Python
Project description
Pumpkin Plugin API for Python
This package provides everything needed to write a Pumpkin server plugin compiled to WebAssembly using Python.
Quick start
- Install
pumpkin-api-py:
pip install pumpkin-api-py
- Create your plugin (
main.py):
from pumpkin_api import (
Plugin, PluginMetadata, register_plugin,
server, event, command, text, context
)
class MyPlugin(Plugin):
def metadata(self) -> PluginMetadata:
return PluginMetadata(
name="my-plugin",
version="0.1.0",
authors=["you"],
description="An example plugin."
)
def on_load(self, ctx: context.Context) -> None:
print("Python plugin loaded!")
# Register an event handler
self.register_event(ctx, event.EventType.PLAYER_JOIN_EVENT, self.on_player_join)
def on_player_join(self, srv: server.Server, evt: event.PlayerJoinEventData) -> event.PlayerJoinEventData:
print(f"Player {evt.player.get_name()} joined!")
return evt
register_plugin(MyPlugin)
- Build your plugin into a WebAssembly component:
pumpkin-api-build main -o my_plugin.wasm
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pumpkin_api_py-0.1.0.dev0.tar.gz
(64.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pumpkin_api_py-0.1.0.dev0.tar.gz.
File metadata
- Download URL: pumpkin_api_py-0.1.0.dev0.tar.gz
- Upload date:
- Size: 64.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
efe7bcd15aab2b883c31a292f0d507d18fa4e161d2a79417f5e6710c625ea73b
|
|
| MD5 |
f2f508ea83e807a69b645bb9136d0adc
|
|
| BLAKE2b-256 |
063af62e640517e2b67e6b0891ff8d3134596e5a15cba7ad286bf3e7ea7e2634
|
File details
Details for the file pumpkin_api_py-0.1.0.dev0-py3-none-any.whl.
File metadata
- Download URL: pumpkin_api_py-0.1.0.dev0-py3-none-any.whl
- Upload date:
- Size: 95.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2dbcf13131a09059a80f3f156ce365953039d4b88a6cc283ed210be3f7fd8817
|
|
| MD5 |
a820975537365aed1be77dbadfdee84d
|
|
| BLAKE2b-256 |
f428e8c47d451e6de6bb93fcb3e8727d03713d7b850ffddb374f89a8356e1433
|