Blockbench Reference Docs
    Preparing search index...

    Actions can be triggered to run something, they can be added to menus, toolbars, assigned a keybinding, or run via Action Control

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    category?: string
    click: (event?: Event) => void

    Type Declaration

      • (event?: Event): void
      • Function to run when user uses the action successfully

        Parameters

        Returns void

    condition?: any
    description: string
    icon: string
    id: string
    keybind: Keybind
    menu_node: HTMLElement
    name: string
    node: HTMLElement
    nodes: HTMLElement[]
    plugin?: string

    The ID of the plugin that created the object

    side_menu?: Menu | ToolConfig

    Provide a menu that belongs to the action, and gets displayed as a small arrow next to it in toolbars.

    tool_config?: ToolConfig

    Provide a window with additional configutation related to the action

    variations?: { [key: string]: { description?: string; name: string } }
    constructing?: BarItem

    Methods

    • Adds a label to the HTML element of the bar item

      Parameters

      • Optionalin_bar: boolean

        Set to true to generate an in-bar label, as opposed to a regular on-hover label

      • Optionalaction: any

        Provide the action to generate the label. This defaults to self and is only needed in special cases

      Returns void

    • Adds a label to the HTML element of the bar item

      Parameters

      • Optionalin_bar: boolean

        Set to true to generate an in-bar label, as opposed to a regular on-hover label

      • Optionalaction: any

        Provide the action to generate the label. This defaults to self and is only needed in special cases

      Returns void

    • Trigger to run or select the action. This is the equivalent of clicking or using a keybind to trigger it. Also checks if the condition is met.

      Parameters

      Returns boolean