Blockbench Reference Docs
    Preparing search index...
    MenuBar: {
        keys: string[];
        last_opened: any;
        menues: Record<string, Menu>;
        menus: {
            animation: BarMenu;
            display: BarMenu;
            edit: BarMenu;
            file: BarMenu;
            help: BarMenu;
            keyframe: BarMenu;
            texture: BarMenu;
            tools: BarMenu;
            transform: BarMenu;
            uv: BarMenu;
            view: BarMenu;
            [id: string]: BarMenu;
        };
        mode_switcher_button: null
        | HTMLDivElement;
        open: Menu | null;
        addAction(action: Action, path?: string): void;
        addMenu(menu: BarMenu, position?: string | number): void;
        openMobile(button: HTMLElement, event?: Event): HTMLElement;
        removeAction(path: string): void;
        setup(): void;
        update(): void;
    }

    Type Declaration

    • keys: string[]
    • last_opened: any
    • mode_switcher_button: null | HTMLDivElement
    • open: Menu | null
    • addAction: function
      • Adds an action to the menu structure

        Parameters

        • action: Action

          Action to add

        • Optionalpath: string

          Path pointing to the location. Use the ID of each level of the menu, or index or group within a level, separated by a point. For example, file.export.0 places the action at the top position of the Export submenu in the File menu.

        Returns void

    • addMenu: function
      • Add a new menu to the menu bar

        Parameters

        • menu: BarMenu

          The BarMenu to add

        • Optionalposition: string | number

          Specify the position in the menu list where to add insert the menu. Can either be an index in the list of all menus, or the ID of the menu to insert right from.

        Returns void

    • openMobile: function
      • Parameters

        • button: HTMLElement
        • Optionalevent: Event

        Returns HTMLElement

    • removeAction: function
      • Parameters

        • path: string

          Path pointing to the location. Use the ID of each level of the menu, or index or group within a level, or item ID, separated by a point. For example, export.export_special_format removes the action "Export Special Format" from the Export submenu.

        Returns void

    • setup: function
      • Returns void

    • update: function
      • Update the menu bar

        Returns void