Link Search Menu Expand Document

Fixed size (8)

If Button

If button refers to interface button click packets which are sent upon clicking any of the normal buttons on the newer interfaces. There are 10 if button packets, ranging from 1 to 10. It should be noted that the “Continue” option on interfaces does not invoke this packet. An example of an interface that uses all ten of the options is bank. Interacting with the items on that interface(e.g. withdraw-1, withdraw-x, examine) uses the corresponding if button packet. It should also be noted that if button 10 is exclusively only used for the “Examine” option.

Payload

All ten of the packets use the exact same structure, and none of them use any byte modifications, nor is their order randomized.

Type Description
Int The interface component that was clicked.
The interface id and component id are packed as two shorts into one integer.
Unsigned Short The slot of element that was clicked. The default value is -1 in absence.
In bank for example, this would refer to the slot of the item in the container.
Unsigned Short The item id of the element that was clicked. If the element isn’t an item, the value -1 is sent.
It should be noted that this variable is strictly used to validate the button click server-side and avoid further clicks from having an effect in the case of the previous clicks in that tick changing the underlying inventory. An example of this would be clicking withdraw-1 of an item twice in your bank while you only own one of that item. Because the state of the item changes server-sided after the first click is processed, the second click would not get processed to begin with, avoiding potential side effects.