Change Resource

Entity Action Type

Changes the value of a power that either uses the Resource (Power Type) or it's extensions, or has a built-in cooldown.

This is a modified version of origins:change_resource that accepts floating-point numbers and works for specific Origins: Math contexts such as Attribute-like Resource.

Type ID: origins-math:change_resource

Warning

Some Resource values in this mod can be internally stored as a Float, but normal Origin Resource powers have to be stored as an Integer.

In this Entity Action Type, floating-point values is preserved as much as possible. However, for standard Origin Resource powers, the value is most likely to have it's decimal counterpart removed, effectively being truncated since it will be added to/set as the value of the actor's resource.

Fields

Field Type Default Description
resource Identifier The namespace and ID of the power that uses the Resource (Power Type) or it's extensions, or has a built-in cooldown.
change Resource-backed Float This value will be added to the resource (won't go below min or above max of the Resource (Power Type)).
operation String "add" Determines if the action should add or set the value of the resource. Accepts "add" or "set".

Examples

"entity_action": {
    "type": "origins:change_resource",
    "resource": "namespace:example",
    "change": 1
}

This example will add 1 to the namespace:example (data/namespace/powers/example.json) power that uses the Resource (Power Type).