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.
IsVisible: optional, one byte.WorldPosition: optional, a WorldPosition.TexturePath: optional, string. Picks the texture the waypoint renders with.IconSize: optional, a Vec2 of two little-endian floats. The client's default is 1 by 1.Color: optional, little-endian int32. The tint the client applies to the texture.ClientPositionAuthority: optional, one byte. When set, the client moves the waypoint itself each tick.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.
texturePath?
string
TexturePath, for example "textures/ui/locator_bar/waypoint".
iconSize?
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
Properties
actorUniqueId?
optionalactorUniqueId?:bigint
Defined in: protocol/src/structure/ServerWaypointPayload.ts:59
ActorUniqueID.
clientPositionAuthority?
optionalclientPositionAuthority?:boolean
Defined in: protocol/src/structure/ServerWaypointPayload.ts:58
ClientPositionAuthority.
color?
optionalcolor?: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?
optionaliconSize?:Vec2
Defined in: protocol/src/structure/ServerWaypointPayload.ts:56
IconSize.
isVisible?
optionalisVisible?:boolean
Defined in: protocol/src/structure/ServerWaypointPayload.ts:53
IsVisible.
texturePath?
optionaltexturePath?: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?
optionalworldPosition?: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
Returns
void
Overrides
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
Returns
void
Overrides
deserialize()
staticdeserialize<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
The binary stream to deserialize from.
Returns
T
An instance of the class T.