PLua is a WASM plugin for the Pumpkin Minecraft server that enables loading and managing plugins written in Lua. It embeds a Lua 5.4 runtime (via piccolo) and proxies Minecraft events to Lua callbacks.
Download plua.wasm from The Pumpkin Market and place it in your Pumpkin server's plugins directory.
git clone https://github.com/PumpkinPlugins/PLua.git
cd PLua
# Add the WASM target
rustup target add wasm32-wasip2
# Build
cargo build --release
# The compiled plugin is at target/wasm32-wasip2/release/plua.wasm- Place
plua.wasmin your Pumpkin server's plugins directory - Start the server — PLua will create its data directory with a
plugins/subfolder - Place
.luaplugin files inplugins/plua/plugins/(relative to the server) - Use the
/pluacommand to manage plugins
/plua list— List all available Lua plugins and their status/plua enable <name>— Enable a plugin/plua disable <name>— Disable a plugin/plua reload— Reload all enabled plugins/plua reload <name>— Reload a specific plugin/plua info <name>— Show plugin metadata
Requires OP level 4 (plua:command.plua permission).
A plugin is a .lua file that returns a table with metadata and optional lifecycle hooks:
return {
name = "MyPlugin",
description = "Does something useful",
version = "1.0.0",
author = "Your Name",
on_enable = function()
pumpkin.log.info("MyPlugin enabled!")
end,
on_disable = function()
pumpkin.log.info("MyPlugin disabled!")
end,
}The on_enable function is called when the plugin is loaded. The on_disable function is called when unloaded. Both are optional.
PLua exposes a global pumpkin table:
pumpkin.log.info("message")
pumpkin.log.warn("message")
pumpkin.log.error("message")
pumpkin.log.debug("message")pumpkin.server.broadcast_message("Hello everyone!")-- Register a listener (returns a listener ID)
local id = pumpkin.events.register_listener("player_join", function(event)
pumpkin.log.info(event.player_name .. " joined!")
end)
-- Unregister later
pumpkin.events.unregister_listener("player_join", id)| Field | Type | Description |
|---|---|---|
player_name |
string | The joining player's name |
join_message |
string | The join message |
cancelled |
boolean | Whether the event was cancelled |
| Field | Type | Description |
|---|---|---|
player_name |
string | The leaving player's name |
leave_message |
string | The leave message |
cancelled |
boolean | Whether the event was cancelled |
| Field | Type | Description |
|---|---|---|
player_name |
string | The player's name |
message |
string | The chat message content |
cancelled |
boolean | Whether the event was cancelled |
| Field | Type | Description |
|---|---|---|
player_name |
string | The player's name |
block_placed |
string | The block being placed |
x, y, z |
integer | Block position |
can_build |
boolean | Whether player can build here |
cancelled |
boolean | Whether the event was cancelled |
| Field | Type | Description |
|---|---|---|
player_name |
string | The player's name (empty if no player) |
block |
string | The block type broken |
x, y, z |
integer | Block position |
exp |
integer | Experience to drop |
should_drop |
boolean | Whether items should drop |
cancelled |
boolean | Whether the event was cancelled |
- PLua uses Lua 5.4 (via piccolo). Luau-specific syntax like
--!strictand type annotations are not supported. - Plugins are loaded from the
plugins/subdirectory inside PLua's data folder. - Plugin files must have a
.luaor.luauextension. - The
stringstandard library is limited; string concatenation (..) works, butstring.formatis not available.
MIT — same as the Pumpkin server.