Skip to content

API reference / @jsprismarine/protocol / PlayerListEntry

Class: PlayerListEntry ​

Defined in: protocol/src/wire/structures/PlayerListEntry.ts:37

One player in a Player List packet.

The packet writes the UUID itself. For an Add entry, networkSerialize writes the rest of the PlayerListAddEntry fields after it.

Constructors ​

Constructor ​

new PlayerListEntry(__namedParameters): PlayerListEntry

Defined in: protocol/src/wire/structures/PlayerListEntry.ts:50

Parameters ​

__namedParameters ​

PlayerListData

Returns ​

PlayerListEntry

Methods ​

getBuildPlatform() ​

getBuildPlatform(): number | null

Defined in: protocol/src/wire/structures/PlayerListEntry.ts:151

Returns ​

number | null


getColor() ​

getColor(): number

Defined in: protocol/src/wire/structures/PlayerListEntry.ts:173

The Player Color as a signed 32-bit ARGB integer.

Returns ​

number


getName() ​

getName(): string | null

Defined in: protocol/src/wire/structures/PlayerListEntry.ts:139

Returns ​

string | null


getPlatformChatId() ​

getPlatformChatId(): string | null

Defined in: protocol/src/wire/structures/PlayerListEntry.ts:147

Returns ​

string | null


getRuntimeId() ​

getRuntimeId(): bigint | null

Defined in: protocol/src/wire/structures/PlayerListEntry.ts:135

Returns ​

bigint | null


getSkin() ​

getSkin(): Skin | null

Defined in: protocol/src/wire/structures/PlayerListEntry.ts:155

Returns ​

Skin | null


getUUID() ​

getUUID(): UUID

Defined in: protocol/src/wire/structures/PlayerListEntry.ts:131

Returns ​

UUID


getXUID() ​

getXUID(): string

Defined in: protocol/src/wire/structures/PlayerListEntry.ts:143

Returns ​

string


isHost() ​

isHost(): boolean

Defined in: protocol/src/wire/structures/PlayerListEntry.ts:163

Returns ​

boolean


isSubClient() ​

isSubClient(): boolean

Defined in: protocol/src/wire/structures/PlayerListEntry.ts:168

Whether the player is a split-screen sub client of another player's device.

Returns ​

boolean


isTeacher() ​

isTeacher(): boolean

Defined in: protocol/src/wire/structures/PlayerListEntry.ts:159

Returns ​

boolean


networkSerialize() ​

networkSerialize(stream, layout?): void

Defined in: protocol/src/wire/structures/PlayerListEntry.ts:85

Writes the PlayerListAddEntry fields that follow the UUID, in wire order: Actor Unique ID (varint64, ZigZag), Player Name, XBL XUID, Platform Online ID, Build Platform (int32, little-endian), Serialized Skin, Is Teacher, Is Host, Is SubClient and Player Color (int32, little-endian).

Parameters ​

stream ​

BinaryStream

layout? ​

SkinWireLayout = SKIN_WIRE_2193

Returns ​

void

Throws ​

Error when the entry has no skin. An Add entry cannot be written without one.


withSkin() ​

withSkin(skin): PlayerListEntry

Defined in: protocol/src/wire/structures/PlayerListEntry.ts:115

A copy of this entry carrying another skin, every other field unchanged.

The session manager keeps the entry it sends to whoever joins later, so a skin change mid-session needs a new entry rather than a mutation of one shared with packets already built from it.

Parameters ​

skin ​

Skin

Returns ​

PlayerListEntry