Skip to main content

Ability Definitions

File: data/<namespace>/saturn/ability/<path>.json. Write type and the type-specific fields directly at the top level, with the common fields in the same object. See Ability types for the type catalogue.

FieldTypeRequiredDefaultDescription
typeAbility type IDyes—Selects a registered ability implementation.
costsArray of costsno[]Costs when the ability is activated.
cast_timeNumber providerno0Casting time in ticks.
iconIconnoomittedTexture or item template.
chargesCharge settingsnoomittedSee the table below.
conditionEntity conditionnoalways trueCondition for using the ability.
hiddenBooleannofalseHides the ability from the host item's tooltip; this does not mean the ability cannot be used.

Charge settings​

FieldTypeRequiredDefaultDescription
maximumNumber provideryes—Maximum number of charges.
recharge_ticksNumber provideryes—Ticks needed to restore one charge.

Example: spend mana to heal​

First create example:mana from the resource definition, then define:

data/example/saturn/ability/heal.json
{
"type": "saturn:active",
"costs": [
{
"type": "saturn:resource",
"resource": "example:mana",
"amount": 10
}
],
"cast_time": 10,
"cooldown": 40,
"icon": {
"id": "minecraft:golden_apple"
},
"entity_action": {
"type": "saturn:heal",
"amount": 4
}
}

Creating a definition does not grant the ability automatically. Grant it through the host mod or the grant_ability action; the source ID determines which source's ability is removed. The type declares the required state storage such as cooldown and charges automatically, so data packs usually do not need to write runtime storage snapshots by hand.