API reference / @jsprismarine/protocol / LegacySlotChange
Class: LegacySlotChange
Defined in: protocol/src/wire/structures/InventoryTransaction.ts:120
One of the docs' Legacy Set Item Slots: a Container Enum (uint8) and its Slots (varuint count, then one uint8 per slot).
The client sends these alongside a valid Legacy Request ID to say which open containers and slots the request touches.
Constructors
Constructor
new LegacySlotChange(
containerId,slots):LegacySlotChange
Defined in: protocol/src/wire/structures/InventoryTransaction.ts:126
Creates one entry.
Parameters
containerId
number
Container Enum.
slots
number[]
The Slots the request touches.
Returns
LegacySlotChange
Properties
containerId
containerId:
number
Defined in: protocol/src/wire/structures/InventoryTransaction.ts:127
Container Enum.
slots
slots:
number[]
Defined in: protocol/src/wire/structures/InventoryTransaction.ts:128
The Slots the request touches.
Methods
toNetwork()
toNetwork(
stream):void
Defined in: protocol/src/wire/structures/InventoryTransaction.ts:147
The mirror of LegacySlotChange.fromNetwork.
Parameters
stream
The stream to append to.
Returns
void
fromNetwork()
staticfromNetwork(stream):LegacySlotChange
Defined in: protocol/src/wire/structures/InventoryTransaction.ts:136
Reads one entry in the docs' order: Container Enum, then the Slots list.
Parameters
stream
The stream positioned at the Container Enum.
Returns
LegacySlotChange
The entry.