Player Data and World Templates (v0.2)
Read-only player snapshots and async helper APIs for world template copy/delete workflows.
On this page
v0.2 archive
Player data and templates
ctx.Gameplay().PlayerData() provides online/offline lookup and cloned snapshots for read access.
- Use
Online,Offline,ByName,ByXUID, andByUUIDfor snapshot access. - Use
ctx.WorldTemplates().Copy(...)for callback-based template copy workflows andDeletefor cleanup. - Use
CopyTask(ctx, request)andDeleteTask(ctx, path)when the caller needs a task handle, cancellation, orAwait.
world-templates-v02.go
ctx.WorldTemplates().Copy(ctx, plugin.WorldTemplateCopyRequest{
TemplatePath: "worlds/templates/duel",
TargetPath: "worlds/arenas/duel-1",
WorldID: "duel-1",
Autosave: true,
}, func(result plugin.WorldTemplateResult) {
if result.Err != nil {
ctx.Logger().Warn("template copy failed", "err", result.Err)
}
})World activation and registration remain server-owned at a higher scope in v0.2.