Player Data and World Templates (v0.2)

Read-only player snapshots and async helper APIs for world template copy/delete workflows.

In this section

Related section pages:

Player data and templates

ctx.Gameplay().PlayerData() provides online/offline lookup and cloned snapshots for read access.

  • Use Online, Offline, ByName, ByXUID, and ByUUID for snapshot access.
  • Use ctx.WorldTemplates().Copy(...) for callback-based template copy workflows and Delete for cleanup.
  • Use CopyTask(ctx, request) and DeleteTask(ctx, path) when the caller needs a task handle, cancellation, or Await.
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.