Appearance
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 โ
attribute โ
Returns โ
AttributeRef
Properties โ
attribute โ
readonlyattribute:Attribute
Defined in: core/frontend/nodes/attribute.ts:35
target โ
readonlytarget: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 โ
ctx? โ
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 โ
ctx? โ
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? โ
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? โ
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? โ
Returns โ
this
remove() โ
remove(
mod,ctx?):this
Defined in: core/frontend/nodes/attribute.ts:84
attribute ... modifier remove.
Parameters โ
mod โ
IdValue | AttributeModifierValue
ctx? โ
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? โ
Returns โ
this
setBase() โ
setBase(
value,ctx?):this
Defined in: core/frontend/nodes/attribute.ts:51
attribute ... base set.
Parameters โ
value โ
number
ctx? โ
Returns โ
this