Blockbench Reference Docs
    Preparing search index...

    Creates a new menu in the menu bar

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    • Adds an action to the menu structure

      Parameters

      • action: Action | CustomMenuItem | "_"

        Action to add

      • Optionalpath: string | number

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

      Returns void

    • Returns boolean

    • Returns void

    • Parameters

      Returns void

      Use removeAction instead

    • Closes the menu if it's open

      Returns this

    • Parameters

      • node: HTMLElement
      • Optionalevent: Event
      • Optionalexpand: boolean

      Returns void

    • Returns void

    • Opens the menu somewhere

      Parameters

      • Optionalposition: MenuOpenPositionAnchor

        Position where to open the menu. Can be a mouse event, or a node that the menu is spawned below.

      • Optionalcontext: any

        Context for the click events inside the menu

      Returns this

    • Remove an action or menu item from the menu

      Parameters

      • path: string | Action

        Path pointing to the location. Use the ID of each level of the menu, or index 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

    • Alias for .open()

      Parameters

      Returns this

    Properties

    children: []
    highlight_action?: MenuItem
    id: string
    label: HTMLElement
    name: string
    node: HTMLUListElement
    options?: MenuOptions
    structure: MenuItem[]
    type: "bar_menu"
    closed_in_this_click?: string
    open: Menu