Go Module API
Statically linked extensions through server-owned services.
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.
Integration and lifecycle
h, err := host.New(host.Options{
BaseDir: baseDir,
Config: cfg,
Modules: []module.Module{myModule},
})Integration fragment: the application supplies baseDir, cfg and myModule. Implement Descriptor, Load, Start and Stop. Dependencies match exact names; versions are informational.
Services
- Commands, events, content, players/worlds/entities discovery, sessions.
- Gameplay, entity AI controllers, scheduling, permissions, player data.
- Storage, world templates, task-backed resource packs.
Gameplay().BlockInventorySnapshot,SetBlockInventorySlot, preload/save tasks, native column regeneration.
Boundaries
BlockInventorySnapshot/SetBlockInventorySlot use existing block containers; they do not create UI. NewVirtualInventory belongs to plugin.Context, not module.Context.
The host closes owned callbacks before Stop. Synchronous cleanup inside Stop remains available; later guarded mutations return ErrPluginStopped. In-flight native calls are not forcibly interrupted.
Checked example
api/testdata/externalmodule in the core is a compiling external consumer. Adapt its local replace paths to your workspace.
go run ./tools/apicheck