Skip to content

API reference / @jsprismarine/protocol / PropertySyncData

Class: PropertySyncData ​

Defined in: protocol/src/structure/PropertySyncData.ts:12

The synched entity properties an actor carries, split by value type.

Wire layout, in docs order: Int Entries List (varuint32 count, then per entry Property Index as varuint32 and Data as varint32), then Float Entries List (varuint32 count, then per entry Property Index as varuint32 and Data as float little endian). https://mojang.github.io/bedrock-protocol-docs/1.26.51/types/property-sync-data/

Extends ​

Constructors ​

Constructor ​

new PropertySyncData(intEntriesList, floatEntriesList): PropertySyncData

Defined in: protocol/src/structure/PropertySyncData.ts:18

Creates the property lists.

Parameters ​

intEntriesList ​

[number, number][]

Int Entries List as [property index, data] pairs.

floatEntriesList ​

[number, number][]

Float Entries List as [property index, data] pairs.

Returns ​

PropertySyncData

Overrides ​

NetworkStructure.constructor

Properties ​

floatEntriesList ​

floatEntriesList: [number, number][]

Defined in: protocol/src/structure/PropertySyncData.ts:20

Float Entries List as [property index, data] pairs.


intEntriesList ​

intEntriesList: [number, number][]

Defined in: protocol/src/structure/PropertySyncData.ts:19

Int Entries List as [property index, data] pairs.

Methods ​

deserialize() ​

deserialize(stream): void

Defined in: protocol/src/structure/PropertySyncData.ts:41

Reads both lists in docs order, replacing whatever the instance held.

Parameters ​

stream ​

NetworkBinaryStream

Returns ​

void

Overrides ​

NetworkStructure.deserialize


serialize() ​

serialize(stream): void

Defined in: protocol/src/structure/PropertySyncData.ts:26

Writes both lists in docs 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