跳转到正文

movement API ​

完整接口目录 · 移动与导航用法 · 工具包下载

模块说明 ​

text
Bounded flat-ground input control; transport success is never arrival proof.

PositionObservation ​

python
@dataclass(frozen=True)
class PositionObservation

SDK 说明:

text
Independent inbound observation, using the same coordinates as AuthInput.

sequence advances only on a new server observation. sampled_at uses this
process's monotonic clock, not wall time or the prediction timestamp.

字段(包含继承字段):

PositionObservation.connection_id ​

python
connection_id: str

数据类字段;声明于 movement.PositionObservation。

PositionObservation.sequence ​

python
sequence: int

数据类字段;声明于 movement.PositionObservation。

PositionObservation.sampled_at ​

python
sampled_at: float

数据类字段;声明于 movement.PositionObservation。

PositionObservation.position ​

python
position: tuple

数据类字段;声明于 movement.PositionObservation。

MovementResult ​

python
@dataclass(frozen=True)
class MovementResult

字段(包含继承字段):

MovementResult.status ​

python
status: str

数据类字段;声明于 movement.MovementResult。

MovementResult.ticks_sent ​

python
ticks_sent: int

数据类字段;声明于 movement.MovementResult。

MovementResult.last_tick ​

python
last_tick: int

数据类字段;声明于 movement.MovementResult。

MovementResult.stopped ​

python
stopped: bool

数据类字段;声明于 movement.MovementResult。

MovementResult.observations ​

python
observations: tuple

数据类字段;声明于 movement.MovementResult。

MovementResult.detail ​

python
detail: str = ''

数据类字段;声明于 movement.MovementResult。

prepare_auth_input_bootstrap ​

python
def prepare_auth_input_bootstrap(
    operations,
    *,
    connection_id,
    expected_auth_input_revision,
    expected_uuid,
    dimension,
    position,
    pitch,
    yaw,
    head_yaw,
    candidate_tick,
    auth_input_height_offset,
    idempotency_key,
    deadline,
)

SDK 说明:

text
Prepare one explicit neutral candidate; perform no IO or automatic retry.

Persist this intent before submitting with Operations. Local admission is
neither a server tick clock nor proof of movement. Preserve unknown results
and reconcile their original operation instead of preparing another attempt.
position is the exact wire position; height offset only validates the query.

MovementController ​

python
class MovementController

SDK 说明:

text
One controller per connection; caller shares control_lock with item actions.

send(frame, timeout=seconds) must return exactly 'dispatched' only after a
confirmed write; any other reply/exception is uncertain and is never retried.
observe(timeout=seconds) returns an independent PositionObservation. Callbacks
must propagate cancellation and enforce their own I/O deadline. This SDK lock
coordinates cooperative callers in one process, not other plugins/clients.

MovementController.__init__ ​

python
def __init__(self, send, observe, *, connection_id, initial_tick, control_lock=None)

MovementController.walk_to ​

python
async def walk_to(self, target, *, timeout=10, speed=0.1, tolerance=0.2, cancel=None)

SDK 说明:

text
Walk at most 8 horizontal blocks on verified flat unobstructed ground.

speed is blocks/tick (20Hz), not blocks/second. No gravity, collision,
stepping, jumping, flight or navigation is synthesized. Corrected positions
rebase the prediction; large corrections and stalled observations abort.
Recreate only after explicit reconciliation if this controller is uncertain.

MovementController.send ​

python
self.send

公开实例属性,在 __init__ 中设置。

MovementController.observe ​

python
self.observe

公开实例属性,在 __init__ 中设置。

MovementController.connection_id ​

python
self.connection_id

公开实例属性,在 __init__ 中设置。

MovementController.tick ​

python
self.tick

公开实例属性,在 __init__ 中设置。

MovementController.control_lock ​

python
self.control_lock

公开实例属性,在 __init__ 中设置。

ManagedMovementTransport ​

python
class ManagedMovementTransport

SDK 说明:

text
Existing managed Operations + independent command position read adapter.

Retains every intent and admitted ID, including ambiguous admission, for the
caller to persist/reconcile. A command query is evidence, not a local predicted
position. It requires command-read permission; latency can limit cadence.

ManagedMovementTransport.__init__ ​

python
def __init__(
    self,
    ctx,
    *,
    connection_id,
    player_name,
    player_uuid,
    dimension,
    auth_input_height_offset,
)

ManagedMovementTransport.send ​

python
async def send(self, frame, *, timeout)

ManagedMovementTransport.observe ​

python
async def observe(self, *, timeout)

ManagedMovementTransport.ctx ​

python
self.ctx

公开实例属性,在 __init__ 中设置。

ManagedMovementTransport.connection_id ​

python
self.connection_id

公开实例属性,在 __init__ 中设置。

ManagedMovementTransport.player_name ​

python
self.player_name

公开实例属性,在 __init__ 中设置。

ManagedMovementTransport.player_uuid ​

python
self.player_uuid

公开实例属性,在 __init__ 中设置。

ManagedMovementTransport.dimension ​

python
self.dimension

公开实例属性,在 __init__ 中设置。

ManagedMovementTransport.height_offset ​

python
self.height_offset

公开实例属性,在 __init__ 中设置。

ManagedMovementTransport.records ​

python
self.records

公开实例属性,在 __init__ 中设置。

ManagedMovementTransport.sequence ​

python
self.sequence

公开实例属性,在 __init__ 中设置。

ManagedMovementTransport.session ​

python
self.session

公开实例属性,在 __init__ 中设置。

NativeMovement ​

python
class NativeMovement

SDK 说明:

text
One managed operation; Host runs the 20 Hz loop under its world gate.

connection_id is the actual self.action_audit native epoch, NOT the SDK
session. Retain operation_id and reconcile unknown instead of calling again.
Cancellation of wait does not cancel the admitted operation: use Host cancel.

NativeMovement.__init__ ​

python
def __init__(self, ctx)

NativeMovement.walk_to ​

python
async def walk_to(
    self,
    target,
    *,
    connection_id,
    initial_tick,
    dimension,
    auth_input_height_offset,
    speed = 0.1,
    tolerance = 0.2,
    timeout_ms = 5000,
    expected_auth_input_revision = None,
    experimental_ground = None,
)

NativeMovement.ctx ​

python
self.ctx

公开实例属性,在 __init__ 中设置。

NativeMovement.intent ​

python
self.intent

公开实例属性,在 __init__、walk_to 中设置。

NativeMovement.operation_id ​

python
self.operation_id

公开实例属性,在 __init__、walk_to 中设置。

Neomega · 使用、开发与参考文档