Blockbench Reference Docs
    Preparing search index...

    Anything that can go into a toolbar, including actions, tools, toggles, widgets etc.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

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

    The ID of the plugin that created the object

    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

    • Gets a copy of the elements HTML node that is not yet in use.

      Returns HTMLElement

    • Gets a copy of the elements HTML node that is not yet in use.

      Returns HTMLElement

    • Adds an event listener to the item

      Parameters

      • event_name: ActionEventName

        The event type to listen for

      • callback: (data: Record<string, any>) => void

      Returns void

    • Adds a single-use event listener to the item

      Parameters

      • event_name: ActionEventName

        The event type to listen for

      • callback: (data: Record<string, any>) => void

      Returns void

    • Appends the bar item to a HTML element

      Parameters

      • destination: string | HTMLElement

      Returns this

    • Appends the bar item to a HTML element

      Parameters

      • destination: HTMLElement

      Returns this