SerenityJS
    Preparing search index...

    Class BlockButtonTrait

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    block: Block

    The block that this trait is attached to.

    components: string[] = ...

    The block component identifiers that this trait is compatible with. If empty, the trait will not be initialized by any component.

    dimension: Dimension

    The dimension that the block is in.

    identifier: string = ...

    The identifier of the trait.

    releaseTick: bigint = -1n

    The tick at which the button will be released.

    state: null | string = ...

    The block state key that this trait is compatible with. If null, the trait will not be initialized by any block state.

    components: string[] = []

    The block component identifiers that this trait is compatible with by default. If empty, the trait will not be initialized by any component.

    identifier: "button"

    The identifier of the trait.

    state: "button_pressed_bit"

    The block state key that this trait is compatible with by default. If null, the trait will not be initialized by any block state.

    types: BlockIdentifier[] = []

    The block type identifiers that this trait is compatible with by default.

    Methods

    • Set the state of the button.

      Parameters

      • state: boolean

        The desired state of the button (true for pressed, false for not pressed).

      • silent: boolean = false

        If the sound event should be played (default is false).

      Returns void