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

helix / Score

Class: Score<S> โ€‹

Defined in: core/frontend/nodes/score.ts:21

A scoreboard slot; S is its Score.scale, so hovers and mismatched ops show the units.

Extends โ€‹

Type Parameters โ€‹

S โ€‹

S extends number = number

Implements โ€‹

Constructors โ€‹

Constructor โ€‹

new Score<S>(objective, target, scale?): Score<S>

Defined in: core/frontend/nodes/score.ts:24

Parameters โ€‹

objective โ€‹

Objective

target โ€‹

ScoreTargetValue

scale? โ€‹

S = ...

Stored units per real unit: at 1000 the score holds thousandths. math formulas, literals and comparisons use real values and convert at the slot.

Returns โ€‹

Score<S>

Overrides โ€‹

TellrawPart.constructor

Properties โ€‹

clickEvent? โ€‹

optional clickEvent?: ClickEvent

Defined in: core/frontend/nodes/tellraw_part.ts:24

Inherited from โ€‹

TellrawPart.clickEvent


hoverEvent? โ€‹

optional hoverEvent?: HoverEvent

Defined in: core/frontend/nodes/tellraw_part.ts:25

Inherited from โ€‹

TellrawPart.hoverEvent


objective โ€‹

objective: Objective

Defined in: core/frontend/nodes/score.ts:25


scale โ€‹

readonly scale: S

Defined in: core/frontend/nodes/score.ts:31

Stored units per real unit: at 1000 the score holds thousandths. math formulas, literals and comparisons use real values and convert at the slot.


style โ€‹

readonly style: TextStyle = {}

Defined in: core/frontend/nodes/tellraw_part.ts:23

Accumulated styling; each fluent method writes one field here.

Inherited from โ€‹

TellrawPart.style


target โ€‹

target: ScoreTargetValue

Defined in: core/frontend/nodes/score.ts:26


type โ€‹

type: string = "score"

Defined in: core/frontend/nodes/score.ts:22

Implementation of โ€‹

ExpressionNode.type

Methods โ€‹

add() โ€‹

add(value, ctx?): this

Defined in: core/frontend/nodes/score.ts:144

scoreboard players add <this> <value>.

Parameters โ€‹

value โ€‹

number

ctx? โ€‹

FunctionContext

Returns โ€‹

this


assign() โ€‹

assign(other, ctx?): this

Defined in: core/frontend/nodes/score.ts:225

this = other (scoreboard players operation ... =).

Parameters โ€‹

other โ€‹

Score<S>

ctx? โ€‹

FunctionContext

Returns โ€‹

this


atLeast() โ€‹

atLeast(input): ExpressionNode

Defined in: core/frontend/nodes/score.ts:91

this >= input.

Parameters โ€‹

input โ€‹

number | Score<S>

Returns โ€‹

ExpressionNode


atMost() โ€‹

atMost(input): ExpressionNode

Defined in: core/frontend/nodes/score.ts:96

this <= input.

Parameters โ€‹

input โ€‹

number | Score<S>

Returns โ€‹

ExpressionNode


bold() โ€‹

bold(value?): this

Defined in: core/frontend/nodes/tellraw_part.ts:33

Parameters โ€‹

value? โ€‹

boolean = true

Returns โ€‹

this

Inherited from โ€‹

TellrawPart.bold


color() โ€‹

color(color): this

Defined in: core/frontend/nodes/tellraw_part.ts:28

Colours this span. Prefer Color.GOLD; #RRGGBB also works.

Parameters โ€‹

color โ€‹

Color | `#${string}`

Returns โ€‹

this

Inherited from โ€‹

TellrawPart.color


countDown() โ€‹

countDown(ctx?): this

Defined in: core/frontend/nodes/score.ts:158

Takes one off while above zero, for cooldowns and timers ticked down each tick.

Parameters โ€‹

ctx? โ€‹

FunctionContext

Returns โ€‹

this


divide() โ€‹

divide(other, ctx?): this

Defined in: core/frontend/nodes/score.ts:241

this /= other (integer division, floors toward -infinity).

Parameters โ€‹

other โ€‹

Score<S>

ctx? โ€‹

FunctionContext

Returns โ€‹

this


enable() โ€‹

enable(ctx?): this

Defined in: core/frontend/nodes/score.ts:203

scoreboard players enable <this>: lets the holder run /trigger on this trigger objective once.

Parameters โ€‹

ctx? โ€‹

FunctionContext

Returns โ€‹

this


equal() โ€‹

equal(input): ExpressionNode

Defined in: core/frontend/nodes/score.ts:76

this = input.

Parameters โ€‹

input โ€‹

number | Score<S>

Returns โ€‹

ExpressionNode


font() โ€‹

font(id): this

Defined in: core/frontend/nodes/tellraw_part.ts:59

Renders this span in another font, e.g. minecraft:illageralt.

Parameters โ€‹

id โ€‹

string

Returns โ€‹

this

Inherited from โ€‹

TellrawPart.font


get() โ€‹

get(ctx?): this

Defined in: core/frontend/nodes/score.ts:167

scoreboard players get <this>: the score as the command's result.

Parameters โ€‹

ctx? โ€‹

FunctionContext

Returns โ€‹

this


greaterThan() โ€‹

greaterThan(input): ExpressionNode

Defined in: core/frontend/nodes/score.ts:81

this > input.

Parameters โ€‹

input โ€‹

number | Score<S>

Returns โ€‹

ExpressionNode


italic() โ€‹

italic(value?): this

Defined in: core/frontend/nodes/tellraw_part.ts:38

Parameters โ€‹

value? โ€‹

boolean = true

Returns โ€‹

this

Inherited from โ€‹

TellrawPart.italic


lessThan() โ€‹

lessThan(input): ExpressionNode

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

this < input.

Parameters โ€‹

input โ€‹

number | Score<S>

Returns โ€‹

ExpressionNode


matches() โ€‹

matches(range): ExpressionNode

Defined in: core/frontend/nodes/score.ts:71

matches <range>: true when the score is in range.

Parameters โ€‹

range โ€‹

Range

Returns โ€‹

ExpressionNode


max() โ€‹

max(other, ctx?): this

Defined in: core/frontend/nodes/score.ts:253

this = max(this, other) (>).

Parameters โ€‹

other โ€‹

Score<S>

ctx? โ€‹

FunctionContext

Returns โ€‹

this


min() โ€‹

min(other, ctx?): this

Defined in: core/frontend/nodes/score.ts:249

this = min(this, other) (<).

Parameters โ€‹

other โ€‹

Score<S>

ctx? โ€‹

FunctionContext

Returns โ€‹

this


minus() โ€‹

minus(other, ctx?): this

Defined in: core/frontend/nodes/score.ts:233

this -= other. (remove is taken for the literal scoreboard players remove.)

Parameters โ€‹

other โ€‹

Score<S>

ctx? โ€‹

FunctionContext

Returns โ€‹

this


modulo() โ€‹

modulo(other, ctx?): this

Defined in: core/frontend/nodes/score.ts:245

this %= other.

Parameters โ€‹

other โ€‹

Score<S>

ctx? โ€‹

FunctionContext

Returns โ€‹

this


obfuscated() โ€‹

obfuscated(value?): this

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

Parameters โ€‹

value? โ€‹

boolean = true

Returns โ€‹

this

Inherited from โ€‹

TellrawPart.obfuscated


onClick() โ€‹

onClick(event): this

Defined in: core/frontend/nodes/tellraw_part.ts:71

Attach a click action (see the click helper).

Parameters โ€‹

event โ€‹

ClickEvent

Returns โ€‹

this

Inherited from โ€‹

TellrawPart.onClick


onHover() โ€‹

onHover(event): this

Defined in: core/frontend/nodes/tellraw_part.ts:77

Attach a hover tooltip (see the hover helper).

Parameters โ€‹

event โ€‹

HoverEvent

Returns โ€‹

this

Inherited from โ€‹

TellrawPart.onHover


operation() โ€‹

operation(op, other, ctx?): this

Defined in: core/frontend/nodes/score.ts:218

scoreboard players operation <this> <op> <other>. Chains; prefer the named verbs (plus, times...).

Emits into the ambient context; pass ctx to override. See currentContext.

Parameters โ€‹

op โ€‹

ScoreOperator

other โ€‹

Score<S>

ctx? โ€‹

FunctionContext

Returns โ€‹

this


plus() โ€‹

plus(other, ctx?): this

Defined in: core/frontend/nodes/score.ts:229

this += other. (add is taken for the literal scoreboard players add.)

Parameters โ€‹

other โ€‹

Score<S>

ctx? โ€‹

FunctionContext

Returns โ€‹

this


readEntity() โ€‹

readEntity(who, path, ctx?): this

Defined in: core/frontend/nodes/score.ts:173

Reads the number at path on who into this, at this slot's scale.

Parameters โ€‹

who โ€‹

Selector

path โ€‹

NbtPathValue

ctx? โ€‹

FunctionContext

Returns โ€‹

this


remove() โ€‹

remove(value, ctx?): this

Defined in: core/frontend/nodes/score.ts:151

scoreboard players remove <this> <value>.

Parameters โ€‹

value โ€‹

number

ctx? โ€‹

FunctionContext

Returns โ€‹

this


reset() โ€‹

reset(ctx?): this

Defined in: core/frontend/nodes/score.ts:197

scoreboard players reset <this> - un-set this holder's score entirely.

Parameters โ€‹

ctx? โ€‹

FunctionContext

Returns โ€‹

this


scaled() โ€‹

scaled<K>(scale): Score<K>

Defined in: core/frontend/nodes/score.ts:37

This slot holding scale units per real unit, e.g. .scaled(Unit.MM) for millimetres.

Type Parameters โ€‹

K โ€‹

K extends number

Parameters โ€‹

scale โ€‹

K

Returns โ€‹

Score<K>


set() โ€‹

set(value, ctx?): this

Defined in: core/frontend/nodes/score.ts:137

scoreboard players set <this> <value>.

Parameters โ€‹

value โ€‹

number

ctx? โ€‹

FunctionContext

Returns โ€‹

this


shadowColor() โ€‹

shadowColor(argb): this

Defined in: core/frontend/nodes/tellraw_part.ts:65

Sets the drop shadow's colour as packed ARGB, e.g. 0x80000000. 0 hides it (1.21.4+).

Parameters โ€‹

argb โ€‹

number

Returns โ€‹

this

Inherited from โ€‹

TellrawPart.shadowColor


storeEntity() โ€‹

storeEntity(who, path, type?, factor?, ctx?): this

Defined in: core/frontend/nodes/score.ts:182

Writes this to path on who as a real number, times a unitless factor.

Parameters โ€‹

who โ€‹

Selector

path โ€‹

NbtPathValue

type? โ€‹

StoreNumType = "double"

factor? โ€‹

number = 1

ctx? โ€‹

FunctionContext

Returns โ€‹

this


strikethrough() โ€‹

strikethrough(value?): this

Defined in: core/frontend/nodes/tellraw_part.ts:48

Parameters โ€‹

value? โ€‹

boolean = true

Returns โ€‹

this

Inherited from โ€‹

TellrawPart.strikethrough


swap() โ€‹

swap(other, ctx?): this

Defined in: core/frontend/nodes/score.ts:257

Swap the two scores (><).

Parameters โ€‹

other โ€‹

Score<S>

ctx? โ€‹

FunctionContext

Returns โ€‹

this


times() โ€‹

times(other, ctx?): this

Defined in: core/frontend/nodes/score.ts:237

this *= other.

Parameters โ€‹

other โ€‹

Score<S>

ctx? โ€‹

FunctionContext

Returns โ€‹

this


underlined() โ€‹

underlined(value?): this

Defined in: core/frontend/nodes/tellraw_part.ts:43

Parameters โ€‹

value? โ€‹

boolean = true

Returns โ€‹

this

Inherited from โ€‹

TellrawPart.underlined

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