Alpha: this compiler is under active development and updates will break your projects. Not recommended for real use yet.
Skip to content

helix / Objective

Class: Objective โ€‹

Defined in: core/frontend/nodes/objective.ts:44

A scoreboard objective. Get one from dp.objective(name); .score(target) reads a slot.

Constructors โ€‹

Constructor โ€‹

new Objective(objective, kind?, displayName?): Objective

Defined in: core/frontend/nodes/objective.ts:45

Parameters โ€‹

objective โ€‹

string

kind? โ€‹

ObjectiveKind = "dummy"

displayName? โ€‹

ComponentValue

The name shown on the sidebar and list, if not the objective's own name.

Returns โ€‹

Objective

Properties โ€‹

displayName? โ€‹

optional displayName?: ComponentValue

Defined in: core/frontend/nodes/objective.ts:49

The name shown on the sidebar and list, if not the objective's own name.


kind โ€‹

kind: ObjectiveKind = "dummy"

Defined in: core/frontend/nodes/objective.ts:47


objective โ€‹

objective: string

Defined in: core/frontend/nodes/objective.ts:46

Methods โ€‹

getName() โ€‹

getName(): string

Defined in: core/frontend/nodes/objective.ts:53

The objective's name.

Returns โ€‹

string


init() โ€‹

init(ctx?): this

Defined in: core/frontend/nodes/objective.ts:75

scoreboard objectives add: creates this objective, into the ambient context or ctx.

Objectives from dp.objective are already created at load; this is for ones built with new.

Parameters โ€‹

ctx? โ€‹

FunctionContext

Returns โ€‹

this


remove() โ€‹

remove(ctx?): this

Defined in: core/frontend/nodes/objective.ts:86

scoreboard objectives remove, into the ambient context or ctx. Clears every score.

Parameters โ€‹

ctx? โ€‹

FunctionContext

Returns โ€‹

this


score() โ€‹

score(target): Score<number>

Defined in: core/frontend/nodes/objective.ts:63

A score holder on this objective: a Selector or a fake-player ScoreTarget.

Parameters โ€‹

target โ€‹

ScoreTargetValue | Selector

Returns โ€‹

Score<number>


setDisplay() โ€‹

setDisplay(slot, ctx?): this

Defined in: core/frontend/nodes/objective.ts:92

scoreboard objectives setdisplay <slot>, e.g. "sidebar" or "sidebar.team.green".

Parameters โ€‹

slot โ€‹

string

ctx? โ€‹

FunctionContext

Returns โ€‹

this

Released under the MIT License ยท Credits
These docs were written with AI; the layout and every page have been reviewed by a human.