Plugin API AutoDoc
AutoDoc: qexed_config_to_mdx
- Commit:
c74f9372d61056392610ce80b3b5d9c8c7194fd0 - ABI:
wasm32-unknown-unknown - Encoding:
postcard
Runtime ABI
Plugins must export linear memory and an allocator. Except for qexed_plugin_init(), event and query functions read postcard payloads through (ptr: i32, len: i32). Query functions return an i64 where the high 32 bits are the response pointer and the low 32 bits are the response length.
qexed_plugin_sdk::qexed_plugin_memory!();
#[unsafe(no_mangle)]
pub extern "C" fn qexed_plugin_priority() -> i32 { 100 }
memory: WASM linear memory export.qexed_plugin_alloc(len: i32) -> i32: Required; the host uses it to write payloads.qexed_plugin_dealloc(ptr: i32, len: i32): Optional; releases buffers written by the host or returned by the plugin.qexed_plugin_priority() -> i32: Optional; larger values run earlier.
Events And Queries
Host Imports
These functions are registered by the server under the qexed import module; prefer the wrappers provided by qexed_plugin_sdk.
Payload Types
PlayerPayload
Player event payload.
PlayerPayloadOwned
Owned player payload used by query structures that need nested player data.
ChunkPayload
Chunk load/unload event payload.
ConfigReloadPayload
Config reload event payload.
LanguagePayload
Language change event payload.
ItemEnchantment
Vanilla enchantment entry.
PluginEnchantment
Plugin-defined enchantment entry.
MiningSpeedQuery
Mining speed query.
MiningSpeedResponse
Mining speed response.
BlockDropPosition
Block position.
BlockDropQuery
Block drop query.
BlockDropResponse
Block drop response.
BlockDropItem
Drop item entry.
BlockStepPosition
Block position stepped on by a player.
PlayerPositionPayload
Player or entity position.
BlockStepPayload
Player block-step query.
PlayerMovePayload
Player movement query.
PlayerInputState
Player input state.
PlayerInputPayload
Player input query.
ClickDetectedPayload
Click detection event payload.
PathfindingQuery
Pathfinding query.
PathfindingResponse
Pathfinding response.
PluginCommandDefinition
Plugin command definition.
PluginCommandQuery
Plugin command execution query.
PluginCommandResponse
Plugin action response.
ProxyConnectResultPayload
Proxy connection result event payload.
PlaceholderQuery
Placeholder resolution query.
PlaceholderContext
Placeholder context key/value pair.
PlaceholderResponse
Placeholder response.
PlaceholderReplacement
Placeholder replacement.
NpcInteractPayload
NPC interaction payload.
NpcEntityPayload
NPC entity payload.
NpcMutationQuery
NPC mutation query.
NpcMutationResponse
NPC mutation response.
NpcMutationOp
NPC mutation operation enum: Upsert or Remove.
NpcUpsert
NPC upsert data.
CustomEntityDefinition
Plugin-defined custom entity definition.
CustomEntityRegistryResponse
Custom entity registry response.
EntityAiTickQuery
Entity AI tick query.
EntityAiEntityPayload
Entity information for an AI tick.
EntityAiPlayerPayload
Nearby player information for an AI tick.
EntityAiTickResponse
Entity AI tick response.
EntityAiOperation
Entity AI operation enum: MoveDelta, LookAt, or Remove.
PlayerAction
Server-side action enum for a player.
Minimal Example
use qexed_plugin_sdk::{PlayerPayload, decode_payload};
qexed_plugin_sdk::qexed_plugin_memory!();
#[unsafe(no_mangle)]
pub extern "C" fn qexed_plugin_player_join(ptr: i32, len: i32) {
let Some(player) = (unsafe { decode_payload::<PlayerPayload>(ptr, len) }) else {
qexed_plugin_sdk::log("player_join decode failed");
return;
};
qexed_plugin_sdk::log(&format!("{} joined", player.username));
}
See plugins/examples for complete examples. command_npc_demo covers commands, NPCs, placeholders, custom entities, and plugin AI.