Skip to content

Change Resource

Note

This action will only work on CCPacks blocks with the Resource Mechanic.

Changes a blocks resource, by either adding or setting.

Type ID: ccpacks:change_resource

Fields

Field Type Default Description
resource Identifier ID of the mechanic type that defines the resource. Must be a Resource (Mechanic Type) which exists on the block.
change Integer This value will be added to the resource.
operation String "add" Determines if the action should add or set the value of the resource. Accepts "add" or "set".

Example

"block_action": {
    "type": "ccpacks:change_resource",
    "resource": "example_pack:fuel",
    "change": 1,
      "operation": "add"
}

This action adds 1 to the example_pack:fuel Resource mechanic. (data\example_pack\mechanics\fuel.json)