Skip to content

本页为英文技术参考;字段、编号与支持状态直接来自同一契约源。中文学习路线见 开发文档。

Minecraft.Worlds ​

Read world metadata and request supported copy, rename, data-pack and backup operations. A world belongs to an instance; its display name does not grant path access.

Contract: nexa.minecraft.worlds/100. API index.

Typical sequence ​

Read the world identity and health, then prepare data-pack changes or other planned operations. Use the returned task to observe long-running copies and backups.

Behavior and limits ​

Delete and restore routes are not fully mapped in this snapshot. Never substitute a live directory overwrite for an unavailable restore operation.

The recorded Host maps 16 of 16 operations in this group. A mapping is subject to permission, phase, scope, platform and business preconditions. Host snapshot identifies the source revision; negotiate against the actual installed Host.

Operations ​

List · Read · ReadMetadata · Copy · Rename · PlanDelete · ListDataPacks · PlanSetDataPack · ApplyDataPackPlan · Backup · PreviewRestore · Restore · ReadHealth · ListBackups · PrepareRestoreDestination · Delete

List ​

EntityRequest → Page<WorldSummary> (wrapper, item)

PropertyContract
Local SDK method ID1
KindQuery
Permissionnexa.minecraft.worlds.read
Legal phasesInitialize, PostInitialize, Checkup, Finalize, Active
IdempotencyReadOnly
Host statusMapped in recorded snapshot

Request fields

FieldTypeMeaning
IdEntityIdIdentity in this model’s domain. Use the identity issued or declared for this object, not a display name or filesystem path.

Successful result

Read Items and continue with NextCursor while preserving the original query. An absent cursor ends the sequence; an invalid cursor is an error.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. A read-only classification does not bypass budgets or guarantee a failed request can be retried indefinitely. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Minecraft_Worlds_List(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Minecraft_Worlds_List_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.

Read ​

EntityRequest → WorldSummary

PropertyContract
Local SDK method ID2
KindQuery
Permissionnexa.minecraft.worlds.read
Legal phasesInitialize, PostInitialize, Checkup, Finalize, Active
IdempotencyReadOnly
Host statusMapped in recorded snapshot

Request fields

FieldTypeMeaning
IdEntityIdIdentity in this model’s domain. Use the identity issued or declared for this object, not a display name or filesystem path.

Successful result

Decode the exact output model after Success. Preserve its identities, revision and schema metadata for subsequent domain operations.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. A read-only classification does not bypass budgets or guarantee a failed request can be retried indefinitely. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Minecraft_Worlds_Read(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Minecraft_Worlds_Read_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.

ReadMetadata ​

EntityRequest → WorldMetadata

PropertyContract
Local SDK method ID3
KindQuery
Permissionnexa.minecraft.worlds.read
Legal phasesInitialize, PostInitialize, Checkup, Finalize, Active
IdempotencyReadOnly
Host statusMapped in recorded snapshot

Request fields

FieldTypeMeaning
IdEntityIdIdentity in this model’s domain. Use the identity issued or declared for this object, not a display name or filesystem path.

Successful result

Decode the exact output model after Success. Preserve its identities, revision and schema metadata for subsequent domain operations.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. A read-only classification does not bypass budgets or guarantee a failed request can be retried indefinitely. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Minecraft_Worlds_ReadMetadata(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Minecraft_Worlds_ReadMetadata_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.

Copy ​

WorldCopyRequest → OperationRef

PropertyContract
Local SDK method ID4
KindOperation
Permissionnexa.minecraft.worlds.write
Legal phasesActive
IdempotencyRequiredKey
Host statusMapped in recorded snapshot

Request fields

FieldTypeMeaning
WorldEntityIdIdentity or revision in this model’s domain; preserve ownership and exact spelling.
DestinationEntityIdIdentity or revision in this model’s domain; preserve ownership and exact spelling.
NamestringDomain value named by this field; additional accepted values and bounds are determined by the operation and Host policy.
ExpectedRevisionRevisionRevision observed before this change. Preserve it exactly; a mismatch requires re-reading and reconciling the target.

Successful result

Work has been admitted. Read or watch the owned operation through Tasks to establish its terminal result; admission is not completion.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. Supply a key for the intended effect and retain that key and inputs while resolving an uncertain reply. Do not retry with changed inputs under the same key. Re-read after revision conflicts; cancellation does not prove rollback. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Minecraft_Worlds_Copy(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Minecraft_Worlds_Copy_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.

Rename ​

WorldRenameRequest → WorldSummary

PropertyContract
Local SDK method ID5
KindMutation
Permissionnexa.minecraft.worlds.write
Legal phasesActive
IdempotencyRequiredKey
Host statusMapped in recorded snapshot

Request fields

FieldTypeMeaning
WorldEntityIdIdentity or revision in this model’s domain; preserve ownership and exact spelling.
NamestringDomain value named by this field; additional accepted values and bounds are determined by the operation and Host policy.
ExpectedRevisionRevisionRevision observed before this change. Preserve it exactly; a mismatch requires re-reading and reconciling the target.

Successful result

Decode the exact output model after Success. Preserve its identities, revision and schema metadata for subsequent domain operations.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. Supply a key for the intended effect and retain that key and inputs while resolving an uncertain reply. Do not retry with changed inputs under the same key. Re-read after revision conflicts; cancellation does not prove rollback. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Minecraft_Worlds_Rename(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Minecraft_Worlds_Rename_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.

PlanDelete ​

EntityRequest → MutationPlan

PropertyContract
Local SDK method ID6
KindQuery
Permissionnexa.minecraft.worlds.read
Legal phasesInitialize, PostInitialize, Checkup, Finalize, Active
IdempotencyReadOnly
Host statusMapped in recorded snapshot

Prepare removal of one admitted world at its current revision. Delete consumes this plan and moves the world into the instance content trash. It does not immediately erase the world bytes.

Request fields

FieldTypeMeaning
IdEntityIdIdentity in this model’s domain. Use the identity issued or declared for this object, not a display name or filesystem path.

Successful result

Retain the exact plan ID and revision, review its bound inputs and confirmation requirement, then use the corresponding commit operation.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. A read-only classification does not bypass budgets or guarantee a failed request can be retried indefinitely. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Minecraft_Worlds_PlanDelete(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Minecraft_Worlds_PlanDelete_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.

ListDataPacks ​

EntityRequest → Page<ContentItem> (wrapper, item)

PropertyContract
Local SDK method ID7
KindQuery
Permissionnexa.minecraft.worlds.read
Legal phasesInitialize, PostInitialize, Checkup, Finalize, Active
IdempotencyReadOnly
Host statusMapped in recorded snapshot

Request fields

FieldTypeMeaning
IdEntityIdIdentity in this model’s domain. Use the identity issued or declared for this object, not a display name or filesystem path.

Successful result

Read Items and continue with NextCursor while preserving the original query. An absent cursor ends the sequence; an invalid cursor is an error.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. A read-only classification does not bypass budgets or guarantee a failed request can be retried indefinitely. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Minecraft_Worlds_ListDataPacks(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Minecraft_Worlds_ListDataPacks_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.

PlanSetDataPack ​

DataPackSelection → MutationPlan

PropertyContract
Local SDK method ID8
KindQuery
Permissionnexa.minecraft.worlds.read
Legal phasesInitialize, PostInitialize, Checkup, Finalize, Active
IdempotencyReadOnly
Host statusMapped in recorded snapshot

Request fields

FieldTypeMeaning
WorldEntityIdIdentity or revision in this model’s domain; preserve ownership and exact spelling.
PacksResourceVersionRef[]Structured ResourceVersionRef value; follow its linked field contract. A bounded collection; do not assume an unbounded result or unspecified ordering.
EnabledOrderQualifiedId[]Identity or revision in this model’s domain; preserve ownership and exact spelling. A bounded collection; do not assume an unbounded result or unspecified ordering.
ExpectedRevisionRevisionRevision observed before this change. Preserve it exactly; a mismatch requires re-reading and reconciling the target.

Successful result

Retain the exact plan ID and revision, review its bound inputs and confirmation requirement, then use the corresponding commit operation.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. A read-only classification does not bypass budgets or guarantee a failed request can be retried indefinitely. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Minecraft_Worlds_PlanSetDataPack(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Minecraft_Worlds_PlanSetDataPack_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.

ApplyDataPackPlan ​

PlanRequest → OperationRef

PropertyContract
Local SDK method ID9
KindOperation
Permissionnexa.minecraft.worlds.write
Legal phasesActive
IdempotencyRequiredKey
Host statusMapped in recorded snapshot

Request fields

FieldTypeMeaning
PlanEntityIdIdentity or revision in this model’s domain; preserve ownership and exact spelling.
ExpectedRevisionRevisionRevision observed before this change. Preserve it exactly; a mismatch requires re-reading and reconciling the target.
ConfirmationTokenstring?Domain value named by this field; additional accepted values and bounds are determined by the operation and Host policy. Nullable; omission is distinct from an empty value. No implicit default is promised by this type.

Successful result

Work has been admitted. Read or watch the owned operation through Tasks to establish its terminal result; admission is not completion.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. Supply a key for the intended effect and retain that key and inputs while resolving an uncertain reply. Do not retry with changed inputs under the same key. Re-read after revision conflicts; cancellation does not prove rollback. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Minecraft_Worlds_ApplyDataPackPlan(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Minecraft_Worlds_ApplyDataPackPlan_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.

Backup ​

EntityRequest → OperationRef

PropertyContract
Local SDK method ID10
KindOperation
Permissionnexa.minecraft.worlds.write
Legal phasesActive
IdempotencyRequiredKey
Host statusMapped in recorded snapshot

Request fields

FieldTypeMeaning
IdEntityIdIdentity in this model’s domain. Use the identity issued or declared for this object, not a display name or filesystem path.

Successful result

Work has been admitted. Read or watch the owned operation through Tasks to establish its terminal result; admission is not completion.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. Supply a key for the intended effect and retain that key and inputs while resolving an uncertain reply. Do not retry with changed inputs under the same key. Re-read after revision conflicts; cancellation does not prove rollback. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Minecraft_Worlds_Backup(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Minecraft_Worlds_Backup_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.

PreviewRestore ​

BackupRestore → MutationPlan

PropertyContract
Local SDK method ID11
KindQuery
Permissionnexa.minecraft.worlds.read
Legal phasesInitialize, PostInitialize, Checkup, Finalize, Active
IdempotencyReadOnly
Host statusMapped in recorded snapshot

Prepare restoration using a backup returned by Worlds.ListBackups and a destination returned by Worlds.PrepareRestoreDestination for that same world. ExpectedRevision belongs to the backup; the destination separately binds the original world revision. The owner restores into a new directory and preserves the original world.

Request fields

FieldTypeMeaning
BackupEntityIdIdentity or revision in this model’s domain; preserve ownership and exact spelling.
DestinationEntityIdIdentity or revision in this model’s domain; preserve ownership and exact spelling.
ExpectedRevisionRevisionRevision observed before this change. Preserve it exactly; a mismatch requires re-reading and reconciling the target.

Successful result

Retain the exact plan ID and revision, review its bound inputs and confirmation requirement, then use the corresponding commit operation.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. A read-only classification does not bypass budgets or guarantee a failed request can be retried indefinitely. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Minecraft_Worlds_PreviewRestore(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Minecraft_Worlds_PreviewRestore_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.

Restore ​

PlanRequest → OperationRef

PropertyContract
Local SDK method ID12
KindOperation
Permissionnexa.minecraft.worlds.write
Legal phasesActive
IdempotencyRequiredKey
Host statusMapped in recorded snapshot

Consume the world restore plan after confirmation. The owner verifies the snapshot, refuses existing or linked destinations, restores to staging, validates level.dat and publishes the new directory. Running games and stale world revisions block restoration.

Request fields

FieldTypeMeaning
PlanEntityIdIdentity or revision in this model’s domain; preserve ownership and exact spelling.
ExpectedRevisionRevisionRevision observed before this change. Preserve it exactly; a mismatch requires re-reading and reconciling the target.
ConfirmationTokenstring?Domain value named by this field; additional accepted values and bounds are determined by the operation and Host policy. Nullable; omission is distinct from an empty value. No implicit default is promised by this type.

Successful result

Work has been admitted. Read or watch the owned operation through Tasks to establish its terminal result; admission is not completion.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. Supply a key for the intended effect and retain that key and inputs while resolving an uncertain reply. Do not retry with changed inputs under the same key. Re-read after revision conflicts; cancellation does not prove rollback. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Minecraft_Worlds_Restore(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Minecraft_Worlds_Restore_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.

ReadHealth ​

EntityRequest → IntegrityReport

PropertyContract
Local SDK method ID13
KindQuery
Permissionnexa.minecraft.worlds.read
Legal phasesInitialize, PostInitialize, Checkup, Finalize, Active
IdempotencyReadOnly
Host statusMapped in recorded snapshot

Request fields

FieldTypeMeaning
IdEntityIdIdentity in this model’s domain. Use the identity issued or declared for this object, not a display name or filesystem path.

Successful result

Decode the exact output model after Success. Preserve its identities, revision and schema metadata for subsequent domain operations.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. A read-only classification does not bypass budgets or guarantee a failed request can be retried indefinitely. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Minecraft_Worlds_ReadHealth(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Minecraft_Worlds_ReadHealth_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.

ListBackups ​

EntityRequest → Page<BackupSummary> (wrapper, item)

PropertyContract
Local SDK method ID14
KindQuery
Permissionnexa.minecraft.worlds.read
Legal phasesInitialize, PostInitialize, Checkup, Finalize, Active
IdempotencyReadOnly
Host statusMapped in recorded snapshot

List snapshots belonging to the admitted world. Returned backup IDs are caller-owned and specific to the world; they cannot be exchanged with general Backups IDs. A maximum of 256 snapshots is returned.

Request fields

FieldTypeMeaning
IdEntityIdIdentity in this model’s domain. Use the identity issued or declared for this object, not a display name or filesystem path.

Successful result

Read Items and continue with NextCursor while preserving the original query. An absent cursor ends the sequence; an invalid cursor is an error.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. A read-only classification does not bypass budgets or guarantee a failed request can be retried indefinitely. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Minecraft_Worlds_ListBackups(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Minecraft_Worlds_ListBackups_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.

PrepareRestoreDestination ​

WorldRestoreDestination → EntityId

PropertyContract
Local SDK method ID15
KindQuery
Permissionnexa.minecraft.worlds.read
Legal phasesInitialize, PostInitialize, Checkup, Finalize, Active
IdempotencyReadOnly
Host statusMapped in recorded snapshot

Admit a new world name under the original instance’s saves directory, bound to the current world revision. The name must be a safe single path component and cannot begin with .nexa-. The destination must not exist. The returned EntityId is authority for PreviewRestore, not a path.

Request fields

FieldTypeMeaning
WorldEntityIdIdentity or revision in this model’s domain; preserve ownership and exact spelling.
NamestringDomain value named by this field; additional accepted values and bounds are determined by the operation and Host policy.
ExpectedRevisionRevisionRevision observed before this change. Preserve it exactly; a mismatch requires re-reading and reconciling the target.

Successful result

Decode the exact output model after Success. Preserve its identities, revision and schema metadata for subsequent domain operations.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. A read-only classification does not bypass budgets or guarantee a failed request can be retried indefinitely. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Minecraft_Worlds_PrepareRestoreDestination(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Minecraft_Worlds_PrepareRestoreDestination_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.

Delete ​

PlanRequest → OperationRef

PropertyContract
Local SDK method ID16
KindOperation
Permissionnexa.minecraft.worlds.write
Legal phasesActive
IdempotencyRequiredKey
Host statusMapped in recorded snapshot

Consume a PlanDelete result after Host confirmation. The world/content owner verifies the world identity, revision, source file facts and running-game state. RestoreTrash can recover the moved directory; ClearTrash is a separate permanent operation.

Request fields

FieldTypeMeaning
PlanEntityIdIdentity or revision in this model’s domain; preserve ownership and exact spelling.
ExpectedRevisionRevisionRevision observed before this change. Preserve it exactly; a mismatch requires re-reading and reconciling the target.
ConfirmationTokenstring?Domain value named by this field; additional accepted values and bounds are determined by the operation and Host policy. Nullable; omission is distinct from an empty value. No implicit default is promised by this type.

Successful result

Work has been admitted. Read or watch the owned operation through Tasks to establish its terminal result; admission is not completion.

Failure and retry

Unavailable capability, denied permission, wrong phase, malformed schema or foreign ownership fails the call. Supply a key for the intended effect and retain that key and inputs while resolving an uncertain reply. Do not retry with changed inputs under the same key. Re-read after revision conflicts; cancellation does not prove rollback. Preserve structured errors; see recovery guidance.

C binding (call fragment; the caller supplies the encoded request and buffers):

c
nx_Minecraft_Worlds_Delete(&reply, request, &options);

The next resume receives the reply. Check nx_reply_success before nx_Minecraft_Worlds_Delete_result. See the complete continuation example and Wasm ownership rules. This fragment is not a standalone guest.


来源: NexaCL-Plugin-SDK · Apache-2.0.

Site documentation: CC BY-SA 4.0. Imported SDK documents: Apache-2.0 as marked.