Blockbench Reference Docs
    Preparing search index...

    Class Blockbench

    Index

    Constructors

    Properties

    Action: typeof Action
    addDragHandler: any
    Animation: typeof _Animation
    AnimationController: typeof AnimationController
    AnimationControllerState: typeof AnimationControllerState
    AnimationItem: typeof AnimationItem
    Animator: typeof Animator
    argv: string[]
    BarItem: typeof BarItem
    BarItems: Record<string, BarItem>
    BarMenu: typeof BarMenu
    BarSelect: typeof BarSelect
    BarSlider: typeof BarSlider
    BarText: typeof BarText
    BillboardFace: any
    BoneAnimator: typeof BoneAnimator
    Codec: typeof Codec
    ColorPicker: typeof ColorPicker
    Cube: typeof Cube
    CubeFace: typeof CubeFace
    Dialog: typeof Dialog
    DisplaySlot: typeof DisplaySlot
    drag_handlers: {}
    EffectAnimator: typeof EffectAnimator
    events: Record<string, Function[]>
    export: any
    exportFile: any
    Face: typeof Face
    findFileFromContent: any
    flags: any[]
    Format: number | ModelFormat
    Group: typeof Group
    import: any
    importFile: any
    InputForm: typeof InputForm
    isLandscape: boolean
    isMobile: boolean
    isTouch: boolean
    isWeb: boolean
    Keybind: typeof Keybind
    KeybindItem: typeof KeybindItem
    Keyframe: any
    KeyframeDataPoint: typeof KeyframeDataPoint
    Language: {
        code: string;
        data: {};
        options: {
            cz: string;
            de: string;
            en: string;
            es: string;
            fr: string;
            it: string;
            ja: string;
            ko: string;
            nl: string;
            pl: string;
            pt: string;
            pt_br: string;
            ru: string;
            sv: string;
            tr: string;
            uk: string;
            vi: string;
            zh: string;
            zh_tw: string;
        };
        toString: () => string;
        addTranslations(language: string, strings: Record<string, string>): void;
    }

    Type Declaration

    • code: string

      Language code indicating the currently selected language

    • data: {}

      Translation data for the current language

    • options: {
          cz: string;
          de: string;
          en: string;
          es: string;
          fr: string;
          it: string;
          ja: string;
          ko: string;
          nl: string;
          pl: string;
          pt: string;
          pt_br: string;
          ru: string;
          sv: string;
          tr: string;
          uk: string;
          vi: string;
          zh: string;
          zh_tw: string;
      }
    • toString: () => string
    • addTranslations: function
      • Add translations for custom translation strings

        Parameters

        • language: string

          Two letter language code, e. G. 'en'

        • strings: Record<string, string>

          Object listing the translation keys and values

        Returns void

    Locator: typeof Locator
    Menu: typeof Menu
    Mesh: typeof Mesh
    MeshFace: typeof MeshFace
    Mode: typeof Mode
    ModelFormat: typeof ModelFormat
    ModelLoader: typeof ModelLoader
    ModelProject: typeof ModelProject
    NodePreviewController: typeof NodePreviewController
    NullObject: typeof NullObject
    NullObjectAnimator: typeof NullObjectAnimator
    NumSlider: typeof NumSlider
    openTime: Date
    operating_system: string
    Outliner: typeof Outliner
    OutlinerElement: typeof OutlinerElement
    OutlinerNode: typeof OutlinerNode
    Painter: typeof Painter
    Panel: typeof Panel
    pickDirectory: any
    platform: string
    Plugin: typeof Plugin
    Preview: typeof Preview
    Project: number | ModelProject
    read: any
    readFile: any
    removeDragHandler: any
    ResizeLine: typeof ResizeLine
    Reusable: typeof Reusable
    Screencam: typeof Screencam
    Setting: typeof Setting
    Settings: {
        dialog: Dialog;
        old: {};
        profile_menu_button: HTMLElement;
        stored: Record<string, SettingsValue>;
        structure: Record<
            string,
            { items: Record<string, Setting>; name: string; open: boolean },
        >;
        addCategory(id: string, data: { name?: string; open?: boolean }): void;
        get(id: string): SettingsValue;
        import(file: any): void;
        openDialog(options?: { profile?: string; search_term?: string }): void;
        save(): void;
        saveLocalStorages(): void;
        showRestartMessage(settings?: Setting[]): void;
        updateProfileButton(): void;
        updateSettingsInProfiles(): void;
    }

    Type Declaration

    • dialog: Dialog
    • old: {}
    • profile_menu_button: HTMLElement
    • stored: Record<string, SettingsValue>
    • structure: Record<string, { items: Record<string, Setting>; name: string; open: boolean }>
    • addCategory: function
      • Parameters

        • id: string
        • data: { name?: string; open?: boolean }

        Returns void

    • get: function
      • Returns the value of the specified setting

        Parameters

        • id: string

        Returns SettingsValue

    • import: function
      • Parameters

        • file: any

        Returns void

    • openDialog: function
      • Parameters

        • Optionaloptions: { profile?: string; search_term?: string }

        Returns void

    • save: function
      • Save the settings and apply changes

        Returns void

    • saveLocalStorages: function
      • Save all settings to the local storage

        Returns void

    • showRestartMessage: function
      • Parameters

        Returns void

    • updateProfileButton: function
      • Returns void

    • updateSettingsInProfiles: function
      • Returns void

    setup_successful: true
    ShapelessDialog: typeof ShapelessDialog
    SharedActions: {
        actions: Record<string, SharedActionHandler[]>;
        add(action_id: string, handler: SharedActionHandler): Deletable;
        condition(action_id: string): boolean;
        find(action_id: string, event?: Event, context?: any): SharedActionHandler;
        run(action_id: string, event?: Event, context?: any): boolean;
        runSpecific(
            action_id: string,
            subject: string,
            event?: Event,
            context?: any,
            force?: boolean,
        ): boolean;
    }

    Type Declaration

    • actions: Record<string, SharedActionHandler[]>
    • add: function
      • Add a method to handle a specific use case of a shared action

        Parameters

        Returns Deletable

    • condition: function
      • Check if there is an active and available handler in the current situation for a shared action

        Parameters

        • action_id: string

        Returns boolean

    • find: function
      • Find the active handler in the current situation for a shared action

        Parameters

        • action_id: string
        • Optionalevent: Event
        • Optionalcontext: any

        Returns SharedActionHandler

    • run: function
      • Run the active handler for a specific subject manually

        Parameters

        • action_id: string

          Action ID

        • Optionalevent: Event

          Event that triggered the interaction

        • Optionalcontext: any

          Optional context variable

        Returns boolean

    • runSpecific: function
      • Run a specific handler manually

        Parameters

        • action_id: string

          Action ID

        • subject: string

          Subject to run on

        • Optionalevent: Event

          Event that triggered the interaction

        • Optionalcontext: any

          Optional context variable

        • Optionalforce: boolean

          Force the specified handler to run and ignore its condition

        Returns boolean

    SplineCurve: any
    SplineHandle: any
    SplineMesh: any
    Texture: typeof Texture
    TextureAnimator: typeof TextureAnimator
    TextureLayer: typeof TextureLayer
    TextureMesh: typeof TextureMesh
    Timeline: typeof Timeline
    TimelineMarker: typeof TimelineMarker
    Toggle: typeof Toggle
    Tool: typeof Tool
    Toolbar: typeof Toolbar
    Toolbox: _ToolToolbar
    ToolConfig: typeof ToolConfig
    version: string
    Widget: typeof Widget
    writeFile: any

    Accessors

    • get isPWA(): boolean

      Returns boolean

    Methods

    • Parameters

      • css: string
      • Optionallayer: string

      Returns Deletable

    • Parameters

      • flag: string

      Returns void

    • Parameters

      • name: string
      • icon: string
      • click: any

      Returns void

    • Type Parameters

      Parameters

      • event_name: T
      • data: D

      Returns any[]

    • Parameters

      Returns void

      Use Undo.initEdit and Undo.finishEdit instead

    • Parameters

      • icon: string | boolean | HTMLElement | (() => string | boolean | HTMLElement)
      • Optionalcolor: string

      Returns HTMLElement

    • Parameters

      • flag: string

      Returns boolean

    • Parameters

      • version: string

      Returns boolean

    • Parameters

      • version: string

      Returns boolean

    • Parameters

      • title: string
      • text: string
      • Optionalicon: string

      Returns void

    • Parameters

      • version: any
      • callback: any

      Returns void

    • Parameters

      • link: string

      Returns void

    • Returns void

    • Returns void

    • Parameters

      • flag: string

      Returns void

    • Type Parameters

      Parameters

      • event_name: T
      • cb: (data: D) => any

      Returns void

    • Parameters

      • name: string

      Returns void

    • Parameters

      • Optionaltext: string

      Returns void

    • Parameters

      • progress: number
      • Optionaltime: number
      • Optionalbar: string

      Returns void

    • Parameters

      • Optionaltext: string

      Returns void

    • Parameters

      • message: any
      • location: any

      Returns void

    • Parameters

      • options: MessageBoxOptions
      • Optionalcb: (
            button: string | number,
            result?: Record<string, boolean>,
            event?: Event,
        ) => void

      Returns MessageBox

    • Parameters

      • message: any
      • Optionaltime: number

      Returns void

    • Parameters

      • message: string
      • Optionaltime: number

      Returns void

    • Parameters

      • options: ToastNotificationOptions

      Returns any

    • Parameters

      • title: string
      • value: string
      • callback: (text: string) => void
      • Optionaloptions: { description?: string; info?: string; placeholder?: string }

        Options

        • Optionaldescription?: string

          Description for the text input

        • Optionalinfo?: string

          Info text

        • Optionalplaceholder?: string

      Returns Promise<unknown>

      Input value