API reference / @jsprismarine/protocol / EnvironmentAttributeData2225
Class: EnvironmentAttributeData2225
Defined in: protocol/src/bedrock/structure/EnvironmentAttributeData2225.ts:113
One EnvironmentAttributeData as protocol 2225 sends it: a named environment attribute of an attribute layer. Protocol 2225 replaced the 2193 field list (see EnvironmentAttributeData) with a Payload variant.
Wire order: AttributeName (string), then Payload as a Cereal tagged variant, a varuint32 selector (the AttributePayloadType value) followed by the alternative's fields. ConstantAttributeData is Attribute. TransitionAttributeData is FromAttribute, ToAttribute, then Settings as TransitionSettingsData: TotalTransitionTicks and CurrentTransitionTicks as varuint32, Easing as a ZigZag varint32 value, ClockName as a string. NoiseTransitionAttributeData is the same three fields with NoiseTransitionSettingsData, which continues with LocalTransitionTicks as a varuint32, NoiseName as a string and NoiseAlignment. Attribute values are encoded as the 2193 layout encodes them, except that FromAttribute and ToAttribute are no longer optional.
See
https://mojang.github.io/bedrock-protocol-docs/1.26.60/types/environment-attribute-data/
Extends
Constructors
Constructor
new EnvironmentAttributeData2225(
attributeName?,payload?):EnvironmentAttributeData2225
Defined in: protocol/src/bedrock/structure/EnvironmentAttributeData2225.ts:114
Parameters
attributeName?
string = ''
AttributeName, at most 128 characters.
payload?
AttributePayload = ...
Payload: a constant value or a transition. Defaults to a constant boolean false.
Returns
EnvironmentAttributeData2225
Overrides
Properties
attributeName
attributeName:
string=''
Defined in: protocol/src/bedrock/structure/EnvironmentAttributeData2225.ts:116
AttributeName, at most 128 characters.
payload
payload:
AttributePayload
Defined in: protocol/src/bedrock/structure/EnvironmentAttributeData2225.ts:118
Payload: a constant value or a transition. Defaults to a constant boolean false.
Methods
deserialize()
deserialize(
stream):void
Defined in: protocol/src/bedrock/structure/EnvironmentAttributeData2225.ts:157
Reads AttributeName and the Payload variant.
Parameters
stream
Returns
void
Throws
when a selector, an enum name or an easing value on the wire matches no known member.
Overrides
serialize()
serialize(
stream):void
Defined in: protocol/src/bedrock/structure/EnvironmentAttributeData2225.ts:127
Writes AttributeName, then the Payload selector and the alternative's fields.
Parameters
stream
Returns
void
Overrides
deserialize()
staticdeserialize<T>(this,stream):T
Defined in: protocol/src/NetworkStructure.ts:29
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.