Skip to content

API reference / @jsprismarine/protocol / PresenceConfig

Class: PresenceConfig ​

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

A presenceConfig: the rich presence a server asks the client to show instead of its own, as ServerPresenceInfoPacket and Server Configuration Join Info (inside StartGamePacket) carry it.

Protocol 2193 wire order: richPresenceId as an optional string, a presence byte followed by the string (a varuint32 byte length then UTF-8) only when set. Mojang's notes cap the id at 50 characters and reject an empty one; absence means the client keeps driving its own rich presence. The mExperienceName and mWorldName fields that preceded it are gone at 2193. https://mojang.github.io/bedrock-protocol-docs/1.26.51/types/presence-config/

Extends ​

Constructors ​

Constructor ​

new PresenceConfig(richPresenceId?): PresenceConfig

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

Parameters ​

richPresenceId? ​

string

richPresenceId, the rich presence to show. Leave unset to let the client decide.

Returns ​

PresenceConfig

Overrides ​

NetworkStructure.constructor

Properties ​

richPresenceId? ​

optional richPresenceId?: string

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

richPresenceId, the rich presence to show. Leave unset to let the client decide.

Methods ​

deserialize() ​

deserialize(stream): void

Defined in: protocol/src/structure/PresenceConfig.ts:32

Reads the presence byte, then richPresenceId when the byte says it follows.

Parameters ​

stream ​

NetworkBinaryStream

Returns ​

void

Overrides ​

NetworkStructure.deserialize


serialize() ​

serialize(stream): void

Defined in: protocol/src/structure/PresenceConfig.ts:26

Writes the presence byte, then richPresenceId when set.

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