Skip to content

API reference / @jsprismarine/protocol / ServerWaypointPayload

Class: ServerWaypointPayload ​

Defined in: protocol/src/structure/ServerWaypointPayload.ts:37

A ServerWaypoint::Payload: the fields of one locator bar waypoint the server wants the client to add or update. Every field after the flag is optional on the wire; a Remove entry carries none of them.

Protocol 2193 wire order: 0. UpdateFlag: little-endian uint32, a bitmask naming which of the fields below the client should apply. Mojang's docs publish no bit numbers for it.

  1. IsVisible: optional, one byte.
  2. WorldPosition: optional, a WorldPosition.
  3. TexturePath: optional, string. Picks the texture the waypoint renders with.
  4. IconSize: optional, a Vec2 of two little-endian floats. The client's default is 1 by 1.
  5. Color: optional, little-endian int32. The tint the client applies to the texture.
  6. ClientPositionAuthority: optional, one byte. When set, the client moves the waypoint itself each tick.
  7. ActorUniqueID: optional, ZigZag varint64. The actor the waypoint follows.

Each optional field is a presence byte, then the value when the byte is 1. https://mojang.github.io/bedrock-protocol-docs/1.26.51/types/server-waypoint-payload/

Extends ​

Constructors ​

Constructor ​

new ServerWaypointPayload(updateFlag?, isVisible?, worldPosition?, texturePath?, iconSize?, color?, clientPositionAuthority?, actorUniqueId?): ServerWaypointPayload

Defined in: protocol/src/structure/ServerWaypointPayload.ts:51

Creates a payload from its fields. Every parameter has a default so the static deserialize can construct an empty instance before reading the stream. An optional field left undefined goes on the wire as a 0 presence byte and nothing else.

Parameters ​

updateFlag? ​

number = 0

UpdateFlag, in [0, 2^32).

isVisible? ​

boolean

IsVisible.

worldPosition? ​

WorldPosition

WorldPosition.

texturePath? ​

string

TexturePath, for example "textures/ui/locator_bar/waypoint".

iconSize? ​

Vec2

IconSize.

color? ​

number

Color, packed ARGB in [-2^31, 2^31). A literal with the alpha byte set is above the range, so pass it as 0xffff0000 | 0.

clientPositionAuthority? ​

boolean

ClientPositionAuthority.

actorUniqueId? ​

bigint

ActorUniqueID.

Returns ​

ServerWaypointPayload

Overrides ​

NetworkStructure.constructor

Properties ​

actorUniqueId? ​

optional actorUniqueId?: bigint

Defined in: protocol/src/structure/ServerWaypointPayload.ts:59

ActorUniqueID.


clientPositionAuthority? ​

optional clientPositionAuthority?: boolean

Defined in: protocol/src/structure/ServerWaypointPayload.ts:58

ClientPositionAuthority.


color? ​

optional color?: number

Defined in: protocol/src/structure/ServerWaypointPayload.ts:57

Color, packed ARGB in [-2^31, 2^31). A literal with the alpha byte set is above the range, so pass it as 0xffff0000 | 0.


iconSize? ​

optional iconSize?: Vec2

Defined in: protocol/src/structure/ServerWaypointPayload.ts:56

IconSize.


isVisible? ​

optional isVisible?: boolean

Defined in: protocol/src/structure/ServerWaypointPayload.ts:53

IsVisible.


texturePath? ​

optional texturePath?: string

Defined in: protocol/src/structure/ServerWaypointPayload.ts:55

TexturePath, for example "textures/ui/locator_bar/waypoint".


updateFlag ​

updateFlag: number = 0

Defined in: protocol/src/structure/ServerWaypointPayload.ts:52

UpdateFlag, in [0, 2^32).


worldPosition? ​

optional worldPosition?: WorldPosition

Defined in: protocol/src/structure/ServerWaypointPayload.ts:54

WorldPosition.

Methods ​

deserialize() ​

deserialize(stream): void

Defined in: protocol/src/structure/ServerWaypointPayload.ts:95

Reads the flag, then the seven optional fields in wire order.

Parameters ​

stream ​

NetworkBinaryStream

Returns ​

void

Overrides ​

NetworkStructure.deserialize


serialize() ​

serialize(stream): void

Defined in: protocol/src/structure/ServerWaypointPayload.ts:78

Writes the flag, then the seven optional fields in wire order.

Parameters ​

stream ​

NetworkBinaryStream

Returns ​

void

Overrides ​

NetworkStructure.serialize


deserialize() ​

static deserialize<T>(this, stream): T

Defined in: protocol/src/NetworkStructure.ts:28

Deserializes the network structure from a binary stream. The constructor runs with no arguments before the stream is read, so the class must tolerate that.

Type Parameters ​

T ​

T extends NetworkStructure

Parameters ​

this ​

Constructor<T>

stream ​

NetworkBinaryStream

The binary stream to deserialize from.

Returns ​

T

An instance of the class T.

Inherited from ​

NetworkStructure.deserialize