Skip to content

API reference / @jsprismarine/protocol / AttributeLayerSettings

Class: AttributeLayerSettings ​

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

The AttributeLayerSettings of an environment attribute layer: how the layer blends with the others and whether it runs. ClientboundAttributeLayerSyncPacket carries it inside each AttributeLayerData and on its own in UpdateAttributeLayerSettingsData.

Protocol 2193 wire order: Priority as a little-endian int32, Weight as a little-endian float, then Enabled and TransitionsPaused as one byte each. Weight became a float shortly before the packet shipped; the earlier AttributeLayerPacket drafts carried it as a float-or-string variant. https://mojang.github.io/bedrock-protocol-docs/1.26.51/types/attribute-layer-settings/

Extends ​

Constructors ​

Constructor ​

new AttributeLayerSettings(priority?, weight?, enabled?, transitionsPaused?): AttributeLayerSettings

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

Parameters ​

priority? ​

number = 0

Priority: layers apply in ascending priority, so a higher one wins.

weight? ​

number = 0

Weight the layer's attributes blend in with.

enabled? ​

boolean = false

Enabled: whether the layer contributes at all.

transitionsPaused? ​

boolean = false

TransitionsPaused: whether the layer's attribute transitions hold their current tick.

Returns ​

AttributeLayerSettings

Overrides ​

NetworkStructure.constructor

Properties ​

enabled ​

enabled: boolean = false

Defined in: protocol/src/structure/AttributeLayerSettings.ts:23

Enabled: whether the layer contributes at all.


priority ​

priority: number = 0

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

Priority: layers apply in ascending priority, so a higher one wins.


transitionsPaused ​

transitionsPaused: boolean = false

Defined in: protocol/src/structure/AttributeLayerSettings.ts:25

TransitionsPaused: whether the layer's attribute transitions hold their current tick.


weight ​

weight: number = 0

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

Weight the layer's attributes blend in with.

Methods ​

deserialize() ​

deserialize(stream): void

Defined in: protocol/src/structure/AttributeLayerSettings.ts:39

Reads Priority, Weight, Enabled, then TransitionsPaused.

Parameters ​

stream ​

NetworkBinaryStream

Returns ​

void

Overrides ​

NetworkStructure.deserialize


serialize() ​

serialize(stream): void

Defined in: protocol/src/structure/AttributeLayerSettings.ts:31

Writes Priority, Weight, Enabled, then TransitionsPaused.

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