0x2F S2FPacketSetSlot
Sets a single slot in an inventory window. Used for cursor updates, specific slot changes, and armor slot updates.
Fields
| Field | Type | Description |
|---|---|---|
| windowId | byte | Window ID (-1 = cursor, 0 = player inv) |
| slot | short | Slot index (-1 = cursor) |
| item | Slot (ItemStack) | ItemStack to place in slot (null = clear) |
Wire Encoding
| Field | Type | Notes |
|---|---|---|
| Window ID | byte | -1=cursor, 0=player inventory |
| Slot | short | Slot index |
| Slot Data | Slot | ItemStack or null |
MCP References
MCP
NetHandlerPlayClient.handleSetSlot()Handler Interface
HND
INetHandlerPlayClientNotes
windowId=-1 special case: updates the cursor item (the item held by the mouse cursor). windowId=0: updates player inventory. S2F is sent for EVERY slot change — armor equips, hotbar changes, cursor picks up/drops. Inventory modules track S2F to detect armor swaps and item pickups.
implementation Implementation Cases
ChestStealer
Track individual slot updates for inventory management.
InvManager
Track individual slot updates for inventory management.
AutoArmor
Track individual slot updates for inventory management.