Interface in @basalt/menus
One slot a click would change. Set cancel to refuse the click: the player’s client puts
everything back as it was. A click that moves items between two of the menu’s slots, or
changes one twice, comes as one event for each.
The server waits for the handler, as it waits for a before event (at most 50 ms); a plugin that doesn’t answer in time has the click refused. The player can’t be read afresh in it.
import type { MenuClickEvent } from '@basalt/menus';Properties
Section titled “Properties”read-only
readonly menu: Menu;Types
player
Section titled “player”read-only
readonly player: Player;Types
read-only
readonly slot: number;action
Section titled “action”read-only
readonly action: MenuClickAction;Types
itemStack
Section titled “itemStack”read-only optional
readonly itemStack?: ItemStack;What the slot holds.
Types
result
Section titled “result”read-only optional
readonly result?: ItemStack;What it will hold if the click goes ahead.
Types
cancel
Section titled “cancel”cancel: boolean;