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

helix / AttributeRef

Class: AttributeRef โ€‹

Defined in: core/frontend/nodes/attribute.ts:32

One entity's attribute, like a Score for attributes.

Verbs emit into the ambient context; pass ctx to override.

Selector.self().attribute(Attribute.MOVEMENT_SPEED) .apply(AttributeModifier.scale(Id("pack:slow"), 0.85));

Constructors โ€‹

Constructor โ€‹

new AttributeRef(target, attribute): AttributeRef

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

Parameters โ€‹

target โ€‹

Selector

attribute โ€‹

Attribute

Returns โ€‹

AttributeRef

Properties โ€‹

attribute โ€‹

readonly attribute: Attribute

Defined in: core/frontend/nodes/attribute.ts:35


target โ€‹

readonly target: Selector

Defined in: core/frontend/nodes/attribute.ts:34

Methods โ€‹

add() โ€‹

add(mod, ctx?): this

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

attribute ... modifier add. Fails in game if the id is already there; see apply.

Parameters โ€‹

mod โ€‹

AttributeModifierValue

ctx? โ€‹

FunctionContext

Returns โ€‹

this


apply() โ€‹

apply(mod, ctx?): this

Defined in: core/frontend/nodes/attribute.ts:79

Sets mod, replacing any modifier with the same id.

Removes first, since modifier add fails when the id is already there.

Parameters โ€‹

mod โ€‹

AttributeModifierValue

ctx? โ€‹

FunctionContext

Returns โ€‹

this


get() โ€‹

get(scale?, ctx?): this

Defined in: core/frontend/nodes/attribute.ts:39

attribute ... get: the current value as the command's result, times scale.

Parameters โ€‹

scale? โ€‹

number

ctx? โ€‹

FunctionContext

Returns โ€‹

this


getBase() โ€‹

getBase(scale?, ctx?): this

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

attribute ... base get: the base value as the command's result, times scale.

Parameters โ€‹

scale? โ€‹

number

ctx? โ€‹

FunctionContext

Returns โ€‹

this


getModifier() โ€‹

getModifier(mod, scale?, ctx?): this

Defined in: core/frontend/nodes/attribute.ts:90

attribute ... modifier value get: the modifier's amount as the command's result, times scale.

Parameters โ€‹

mod โ€‹

IdValue | AttributeModifierValue

scale? โ€‹

number

ctx? โ€‹

FunctionContext

Returns โ€‹

this


remove() โ€‹

remove(mod, ctx?): this

Defined in: core/frontend/nodes/attribute.ts:84

attribute ... modifier remove.

Parameters โ€‹

mod โ€‹

IdValue | AttributeModifierValue

ctx? โ€‹

FunctionContext

Returns โ€‹

this


resetBase() โ€‹

resetBase(ctx?): this

Defined in: core/frontend/nodes/attribute.ts:57

attribute ... base reset: back to the entity type's default.

Parameters โ€‹

ctx? โ€‹

FunctionContext

Returns โ€‹

this


setBase() โ€‹

setBase(value, ctx?): this

Defined in: core/frontend/nodes/attribute.ts:51

attribute ... base set.

Parameters โ€‹

value โ€‹

number

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.