Skip to content

API reference / @jsprismarine/protocol / SerializedAbilityLayer

Class: SerializedAbilityLayer ​

Defined in: protocol/src/structure/SerializedAbilityLayer.ts:15

One "SerializedAbilitiesDataSerializedLayer" entry of a SerializedAbilitiesData.

Wire order, all little-endian: "SerializedLayer" uint16, "AbilitiesSet" uint32, "AbilityValues" uint32, "FlySpeed" float, "VerticalFlySpeed" float, "WalkSpeed" float. "AbilitiesSet" marks which AbilitiesIndex bits the layer carries and "AbilityValues" holds their booleans. The three speed indices (13, 14, 19) have no value bit; their presence in "AbilitiesSet" says the matching float applies. https://mojang.github.io/bedrock-protocol-docs/1.26.51/types/serialized-abilities-data-serialized-layer/

Extends ​

Constructors ​

Constructor ​

new SerializedAbilityLayer(layer, abilitiesSet, abilityValues, flySpeed, verticalFlySpeed, walkSpeed): SerializedAbilityLayer

Defined in: protocol/src/structure/SerializedAbilityLayer.ts:16

Parameters ​

layer ​

number

abilitiesSet ​

number

abilityValues ​

number

flySpeed ​

number

verticalFlySpeed ​

number

walkSpeed ​

number

Returns ​

SerializedAbilityLayer

Overrides ​

NetworkStructure.constructor

Properties ​

abilitiesSet ​

abilitiesSet: number

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


abilityValues ​

abilityValues: number

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


flySpeed ​

flySpeed: number

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


layer ​

layer: number

Defined in: protocol/src/structure/SerializedAbilityLayer.ts:17


verticalFlySpeed ​

verticalFlySpeed: number

Defined in: protocol/src/structure/SerializedAbilityLayer.ts:21


walkSpeed ​

walkSpeed: number

Defined in: protocol/src/structure/SerializedAbilityLayer.ts:22

Methods ​

deserialize() ​

deserialize(stream): void

Defined in: protocol/src/structure/SerializedAbilityLayer.ts:36

Deserializes the network structure from a binary stream.

Parameters ​

stream ​

BinaryStream

The binary stream to deserialize from.

Returns ​

void

Overrides ​

NetworkStructure.deserialize


serialize() ​

serialize(stream): void

Defined in: protocol/src/structure/SerializedAbilityLayer.ts:27

Serializes the network structure to a binary stream.

Parameters ​

stream ​

BinaryStream

The binary stream to serialize to.

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