Hierarchy

Properties

color?: string | ((entity: undefined | default<unknown, number, EntityReferenceTypes, unknown>, stat: IStat) => string)

The CSS variable to use for the stat bar color Defaults to white

darkColor?: string | ((entity: undefined | default<unknown, number, EntityReferenceTypes, unknown>, stat: IStat) => string)

The CSS variable to use for the background of the stat bar Defaults to black

displayOrder?: number

For the order this stat displays in. Smaller numbers appear higher in the list.

Not providing displayPriority uses 100.

displayType?: StatDisplayType

Defaults to StatDisplayType.Auto

imageCount?: number

The number of alternate textures that this image has. Not supported for most things.

imagePath?: string | ((entity: undefined | default<unknown, number, EntityReferenceTypes, unknown>, stat: IStat) => string)

A replacement image to use. Used in modding.

Do not provide or modify this value, only reference it. This is set by the modding system during the process of registration.

This stat displays as multiple sub-stats. (Incompatible with all other properties)

Sub-stats always display as StatDisplayType.Attribute

onChange?: ((statElement: default<HTMLElement>, entity: default<unknown, number, EntityReferenceTypes, unknown>, stat: IStat, oldValue?: number) => void)[]

Handlers for when the stat changes. Called when the stat changes & when the stat max changes.

rgbColor?: string | ((entity: undefined | default<unknown, number, EntityReferenceTypes, unknown>, stat: IStat) => string)

The CSS variable to use for the stat bar color in RGB format Defaults to white

subscriber?: ((events: IStatDisplayDescriptionSubscriber, refresh: (() => void)) => any)

Type declaration

tooltip?: Reference | ((tooltip: default, entity: default<unknown, number, EntityReferenceTypes, unknown>, stat: IStat) => any)

A function that will initialize a tooltip for this stat element, or a reference to show a tooltip for

unlockable?: true

Whether this stat display should be unlockable. (Unlocked by doing player.addMilestone(Milestone.InternalStatDiscovery, stat))

Methods

  • Parameters

    Returns undefined | number

  • Parameters

    Returns undefined | number

Generated using TypeDoc