Skip to content

API reference / @jsprismarine/protocol / PlayerPartyInfo

Class: PlayerPartyInfo ​

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

A PlayerPartyInfo: the platform party a player is in and whether it leads that party. PartyChangedPacket carries one, and the login ConnectionRequest reports the same pair.

Protocol 2193 wire order: 0. party_id: string, at most 49 characters. Empty when the player is in no party.

  1. is_party_leader: one byte. https://mojang.github.io/bedrock-protocol-docs/1.26.51/types/player-party-info/

Extends ​

Constructors ​

Constructor ​

new PlayerPartyInfo(partyId?, isPartyLeader?): PlayerPartyInfo

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

Creates the party info from its fields. Both parameters have a default so the static deserialize can construct an empty instance before reading the stream.

Parameters ​

partyId? ​

string = ''

party_id, the platform's party identifier; empty for no party.

isPartyLeader? ​

boolean = false

is_party_leader.

Returns ​

PlayerPartyInfo

Overrides ​

NetworkStructure.constructor

Properties ​

isPartyLeader ​

isPartyLeader: boolean = false

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

is_party_leader.


partyId ​

partyId: string = ''

Defined in: protocol/src/structure/PlayerPartyInfo.ts:24

party_id, the platform's party identifier; empty for no party.

Methods ​

deserialize() ​

deserialize(stream): void

Defined in: protocol/src/structure/PlayerPartyInfo.ts:37

Reads the id then the leader flag.

Parameters ​

stream ​

NetworkBinaryStream

Returns ​

void

Overrides ​

NetworkStructure.deserialize


serialize() ​

serialize(stream): void

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

Writes the id then the leader flag.

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