Go Plugin API
Native plugin contracts and handles, not a universal ABI.
On this page
Typed Content: items and blocks
For ordinary native Go content, use module.TypedContent(ctx) during Load: typed semantic definitions, enabled-stack resource validation, per-protocol lowering and atomic publication/freeze before players. This API documentation follows core commit 8f711a26; source/wire checks do not certify live-client acceptance.
Choose the entry point
Start with Go modules for statically linked extensions through narrow services. core/plugin exposes a broader context/handle API, including experimental virtual inventory. Both native paths are fully trusted.
Init → Start → Stop
Register commands, events and content in Init. Mutate through ctx.Gameplay() and handles, not raw server objects. Stop runs in reverse order; owned callbacks close before it.
Current contracts
Use errors.Is for sentinels. After Stop, guarded mutations return ErrPluginStopped. Invalid single-slot stacks return item.ErrInvalidStack without changing the slot. v0.2 is an archive, not the preferred entry point.