Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Teleport handling

cinnabar:extension/teleport-handling@0.1.0

Local-player MovePlayer rotations before they apply, for handle-teleport.

Grants: camera to run handle-teleport; this interface only defines handler types.

Types

rotation

Bedrock degrees: yaw turns clockwise from south; positive pitch looks down.

record rotation {
    yaw: f32,
    pitch: f32,
}
MemberTypeDescription
yawf32
pitchf32

teleport-mode

How the server moved the local player, as MovePlayer reports it.

enum teleport-mode {
    normal,
    reset,
    teleport,
    rotation,
    other,
}
MemberTypeDescription
normal
reset
teleport
rotation
other

teleport-context

One committed MovePlayer for the local player. Only rotation is changeable; position, physics and acknowledgments always follow the server.

record teleport-context {
    mode: teleport-mode,
    server: rotation,
    presented: rotation,
    rotation: rotation,
}
MemberTypeDescription
modeteleport-mode
serverrotationThe rotation the server sent.
presentedrotationThe local view immediately before this move.
rotationrotationThe rotation the view takes: the server’s, or an earlier handler’s replacement.
Set it to presented to keep the current view.

Types: rotation, teleport-mode.

Functions

This interface defines shared types and has no functions.