Skip to content
BasaltSoftware
Bedrock 1.26.60

Site colour

Discord
Esc

    ↑↓ moveEnter openEsc close

    Keyboard shortcuts
    Ctrl K
    Search the whole site, from any page
    /
    Jump to the sidebar search, or search the whole site where there isn't one
    Enter
    Open the top search result
    Esc
    Clear the search, or close this panel
    ?
    Show these shortcuts
    @basalt/menus

    MenuClickEvent

    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';

    read-only

    readonly menu: Menu;
    Types

    read-only

    readonly player: Player;
    Types

    read-only

    readonly slot: number;

    read-only

    readonly action: MenuClickAction;

    read-only optional

    readonly itemStack?: ItemStack;

    What the slot holds.

    read-only optional

    readonly result?: ItemStack;

    What it will hold if the click goes ahead.

    cancel: boolean;

    Menu.setItem, Menu.onClick