API reference / @jsprismarine/protocol / ActorLink
Class: ActorLink
Defined in: protocol/src/structure/ActorLink.ts:13
A link between two actors, such as a rider and its vehicle.
Wire layout, in docs order: Target A and Target B (each an ActorUniqueID, varint64), Type (uint8 ActorLinkType: 0 None, 1 Riding, 2 Passenger), Immediate (boolean), Passenger Initiated (boolean, whether the passenger changed the link), and Vehicle Angular Velocity (float little endian). https://mojang.github.io/bedrock-protocol-docs/1.26.51/types/actor-link/
Extends
Constructors
Constructor
new ActorLink(
actorAUniqueID,actorBUniqueID,type,immediate,riderInitiated,vehicleAngularVelocity):ActorLink
Defined in: protocol/src/structure/ActorLink.ts:23
Creates a link.
Parameters
actorAUniqueID
bigint
Target A, the vehicle's unique id.
actorBUniqueID
bigint
Target B, the rider's unique id.
type
number
Type, an ActorLinkType value.
immediate
boolean
Immediate, whether the client applies the link without interpolating.
riderInitiated
boolean
Passenger Initiated, whether the passenger changed the link.
vehicleAngularVelocity
number
Vehicle Angular Velocity.
Returns
ActorLink
Overrides
Properties
actorAUniqueID
actorAUniqueID:
bigint
Defined in: protocol/src/structure/ActorLink.ts:24
Target A, the vehicle's unique id.
actorBUniqueID
actorBUniqueID:
bigint
Defined in: protocol/src/structure/ActorLink.ts:25
Target B, the rider's unique id.
immediate
immediate:
boolean
Defined in: protocol/src/structure/ActorLink.ts:27
Immediate, whether the client applies the link without interpolating.
riderInitiated
riderInitiated:
boolean
Defined in: protocol/src/structure/ActorLink.ts:28
Passenger Initiated, whether the passenger changed the link.
type
type:
number
Defined in: protocol/src/structure/ActorLink.ts:26
Type, an ActorLinkType value.
vehicleAngularVelocity
vehicleAngularVelocity:
number
Defined in: protocol/src/structure/ActorLink.ts:29
Vehicle Angular Velocity.
Methods
deserialize()
deserialize(
stream):void
Defined in: protocol/src/structure/ActorLink.ts:45
Reads the six fields in docs order.
Parameters
stream
Returns
void
Overrides
serialize()
serialize(
stream):void
Defined in: protocol/src/structure/ActorLink.ts:35
Writes the six fields in docs 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.