Plugin lifecycle
Registration, startup and shutdown of a native Go plugin.
On this page
Init
Init(plugin.Context) registers commands, subscriptions and content. Keep context for runtime handlers. Do not write directly to server-owned state.
Start
Start receives a context after plugin initialization. Owned scheduler callbacks are cancelled by the host; the plugin must stop unmanaged goroutines.
Stop
The host closes owned callbacks before Stop. Synchronous gameplay cleanup remains available inside Stop; later guarded handle/facade mutations fail with plugin.ErrPluginStopped. Admitted native calls are not interrupted.
Virtual inventory
Scope cleanup destroys virtual inventories. They have separate destroyed/ownership errors, not a promise of ErrPluginStopped from every method.