Open Screen
Play 0x3B, server → client.
play · 0x3B · clientbound (server → client)
Opens a container screen on the client with window id windowId, screen type inventoryType, and a windowTitle text component. The server sends it when the player opens a chest, furnace, crafting table, or other container. The client shows the screen; the horse inventory uses HorseScreenOpen instead.
Sent by the server, read by the client. Listen for it with client.on("OpenScreen", (data) => …) on the receiving side.
Fields
| Field | Type | Notes |
|---|---|---|
windowId |
VarInt | |
inventoryType |
VarInt | |
windowTitle |
NBT |
Send it
await client.sendPacket("OpenScreen", {
windowId: 1, // nonzero; 0 is the player inventory
inventoryType: 2, // generic_9x3: a double chest is 5 (generic_9x6)
windowTitle: { text: "Loot" },
});
await client.sendPacket("ContainerSetContent", {
windowId: 1,
stateId: 1,
slotData: Array(27 + 36).fill(helpers.emptySlot()),
carriedItem: helpers.emptySlot(),
});
inventoryType is the menu registry ID: 0 to 5 are generic_9x1 to generic_9x6, 6 is generic_3x3, 7 crafter_3x3, 8 anvil, 9 beacon, 10 blast_furnace, 11 brewing_stand, 12 crafting, 13 enchantment, 14 furnace, 15 grindstone, 16 hopper, 17 lectern, 18 loom, 19 merchant, 20 shulker_box, 21 smithing, 22 smoker, 23 cartography_table, 24 stonecutter. Fill it with ContainerSetContent; the client sends ContainerClose when the player closes it.
Field aliases listed under Notes are accepted as alternative keys when writing.
Source: src/Core/Versions/776/Packets/play/clientbound/OpenScreen.ts