Skip to content

helix / Score

Class: Score

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

Extends

Implements

Constructors

Constructor

new Score(objective, target, value?): Score

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

Parameters

objective

Objective

target

ScoreTargetValue

value?

number

Returns

Score

Overrides

TellrawPart.constructor

Properties

clickEvent?

optional clickEvent?: ClickEvent

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

Inherited from

TellrawPart.clickEvent


hoverEvent?

optional hoverEvent?: HoverEvent

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

Inherited from

TellrawPart.hoverEvent


objective

objective: Objective

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


style

readonly style: TextStyle = {}

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

Accumulated styling; each fluent method writes one field here.

Inherited from

TellrawPart.style


target

target: ScoreTargetValue

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


type

type: string = "score"

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

Implementation of

ExpressionNode.type


value?

optional value?: number

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

Methods

add()

add(value, ctx?): this

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

Parameters

value

number

ctx?

FunctionContext

Returns

this


applySet()

applySet(ctx): this

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

Parameters

ctx

FunctionContext

Returns

this


assign()

assign(other, ctx?): this

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

this = other (scoreboard players operation … =).

Parameters

other

Score

ctx?

FunctionContext

Returns

this


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

Colour this span. Prefer the typed Color.GOLD; a raw #RRGGBB hex string is also accepted for custom colours.

Parameters

color

Color | `#${string}`

Returns

this

Inherited from

TellrawPart.color


copy()

copy(ctx, score): void

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

Parameters

ctx

FunctionContext

score

Score

Returns

void


divide()

divide(other, ctx?): this

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

this /= other (integer division, floors toward −∞).

Parameters

other

Score

ctx?

FunctionContext

Returns

this


equal()

equal(input): ExpressionNode

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

Parameters

input

number | Score

Returns

ExpressionNode


greaterThan()

greaterThan(input): ExpressionNode

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

Parameters

input

number | Score

Returns

ExpressionNode


invert()

invert(): Condition

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

Returns

Condition


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:46

Parameters

input

number | Score

Returns

ExpressionNode


max()

max(other, ctx?): this

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

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

Parameters

other

Score

ctx?

FunctionContext

Returns

this


min()

min(other, ctx?): this

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

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

Parameters

other

Score

ctx?

FunctionContext

Returns

this


minus()

minus(other, ctx?): this

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

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

Parameters

other

Score

ctx?

FunctionContext

Returns

this


modulo()

modulo(other, ctx?): this

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

this %= other.

Parameters

other

Score

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:59

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:65

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:88

scoreboard players operation <this> <op> <other> - typed score-to-score arithmetic. The named verbs below (plus, times, …) delegate here; use this directly only for a dynamic operator. Returns this, so a run of operations on the same score chains: acc.times(k).plus(d).

The emitting context is the ambient one (the build/run/if callback you are inside). Pass ctx explicitly only to override it - e.g. when two contexts are in scope and you mean the outer one. See currentContext.

Parameters

op

ScoreOperator

other

Score

ctx?

FunctionContext

Returns

this


plus()

plus(other, ctx?): this

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

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

Parameters

other

Score

ctx?

FunctionContext

Returns

this


remove()

remove(value, ctx?): this

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

Parameters

value

number

ctx?

FunctionContext

Returns

this


set()

set(value, ctx?): this

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

Parameters

value

number

ctx?

FunctionContext

Returns

this


storeResult()

storeResult(ctx, command): void

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

Parameters

ctx

FunctionContext

command

ASTNode

Returns

void


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:131

Swap the two scores (><).

Parameters

other

Score

ctx?

FunctionContext

Returns

this


times()

times(other, ctx?): this

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

this *= other.

Parameters

other

Score

ctx?

FunctionContext

Returns

this


toExecuteIf()

toExecuteIf(): string

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

Returns

string


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