Skip to content

API reference / @jsprismarine/protocol / Structure / FullContainerName

Class: FullContainerName ​

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

A FullContainerName: which container a slot belongs to. Container Name is a ContainerEnumName (ContainerUiId in @jsprismarine/minecraft) written as one byte, then Dynamic ID tells apart several open containers of the same kind.

On the wire Dynamic ID is an optional: one presence byte, then a little-endian uint32 when present. The 2193 schema lists it as a required uint32 and only records the optional from 2207 on, but gophertunnel at 2193 and the live 1.26.50 client both write the presence byte. ContainerRegistryCleanupPacket and the ItemStackRequest slot infos use it. https://mojang.github.io/bedrock-protocol-docs/1.26.51/types/full-container-name/

Extends ​

Constructors ​

Constructor ​

new FullContainerName(containerId?, dynamicId?): FullContainerName

Defined in: protocol/src/structure/FullContainerName.ts:22

Parameters ​

containerId? ​

ContainerUiId = ContainerUiId.INVENTORY

Container Name.

dynamicId? ​

number | null = null

Dynamic ID, or null when the container is not dynamic.

Returns ​

FullContainerName

Overrides ​

NetworkStructure.constructor

Properties ​

containerId ​

containerId: ContainerUiId = ContainerUiId.INVENTORY

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

Container Name.


dynamicId ​

dynamicId: number | null = null

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

Dynamic ID, or null when the container is not dynamic.

Methods ​

deserialize() ​

deserialize(stream): void

Defined in: protocol/src/structure/FullContainerName.ts:40

Reads the Container Name byte, then Dynamic ID when its presence byte says one follows.

Parameters ​

stream ​

NetworkBinaryStream

Returns ​

void

Overrides ​

NetworkStructure.deserialize


serialize() ​

serialize(stream): void

Defined in: protocol/src/structure/FullContainerName.ts:33

Writes the Container Name byte, then the Dynamic ID presence byte and, when set, the id as a little-endian uint32.

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