Skip to content
mc-protocol
Esc
↑↓navigate↵open⌘Jpreview
On this page

Container Set Slot

Play 0x14, server → client.

play · 0x14 · clientbound (server → client)

Sets a single slot in the window windowId to item. Window -1 sets the cursor item; window -2 sets a player inventory slot without a window. The server sends it whenever one slot changes. The client updates that slot and uses stateId to detect stale updates.

Sent by the server, read by the client. Listen for it with client.on("ContainerSetSlot", (data) => …) on the receiving side.

Fields

Field Type Notes
windowId ContainerID
stateId VarInt
slot Short
item Slot also slotData

Send it

await client.sendPacket("ContainerSetSlot", {
  windowId: /* ContainerID */,
  stateId: /* VarInt */,
  slot: /* Short */,
  item: /* Slot */,
});

Field aliases listed under Notes are accepted as alternative keys when writing.

Source: src/Core/Versions/776/Packets/play/clientbound/ContainerSetSlot.ts

Was this page helpful?