Skip to main content
Version: 26.1+

Ability State Handlers

State handlers control the lifecycle of an ability. They are set on the state field of an ability definition inside a power JSON.

"state": {
"unlocking": { ... },
"enabling": { ... }
}

Both fields are optional. Omitting unlocking means the ability is always unlocked; omitting enabling means the ability is always enabled.

Each field accepts one of two forms:

  • A typed handler object (using the type field): handlers like palladium:key_bind or the buyable variants.
  • A list of Conditions: automatically wrapped into a palladium:conditional handler. A list is treated as AND (all must pass).

You cannot combine multiple handlers together; if you need complex logic, use the condition system instead.


Unlocking Handlers

Unlocking determines whether the player has access to the ability at all. A locked ability is displayed with a "lock" icon and cannot be enabled.

Condition shorthand

Passing a list of conditions directly is a shorthand for palladium:conditional. This covers the majority of unlocking use cases.

"unlocking": [
{ "type": "palladium:has_effect", "effect": "minecraft:strength" },
{ "type": "palladium:crouching" }
]

palladium:conditional

Unlocks the ability automatically when a condition is fulfilled.

FieldTypeDefaultDescription
conditionsCondition(s)Required. The condition(s) that must be true for the ability to be unlocked.
"unlocking": {
"type": "palladium:conditional",
"conditions": { "type": "palladium:has_effect", "effect": "minecraft:strength" }
}
"unlocking": {
"type": "palladium:conditional",
"conditions": [
{ "type": "palladium:has_effect", "effect": "minecraft:strength" },
{ "type": "palladium:crouching" }
]
}

palladium:experience_level_buyable

The ability starts locked. The player must click it in the power screen and spend XP levels to unlock it permanently.

FieldTypeDefaultDescription
xp_levelIntegerRequired. Number of XP levels consumed on purchase.
requiresCondition(s)Optional additional conditions. Once unlocked/purchased, these conditions need to be fulfilled for the ability to be unlocked.
"unlocking": {
"type": "palladium:experience_level_buyable",
"xp_level": 5,
"requires": [
{ "type": "palladium:has_effect", "effect": "minecraft:strength" },
{ "type": "palladium:crouching" }
]
}

palladium:item_buyable

The ability starts locked. The player must click it in the power screen and have the required items in their inventory, which are consumed on purchase.

FieldTypeDefaultDescription
ingredientIngredientRequired. Item(s) accepted as payment. Supports vanilla ingredient system.
amountPositive Integer1Number of items consumed.
requiresCondition(s)Optional additional conditions. Once unlocked/purchased, these conditions need to be fulfilled for the ability to be unlocked.
"unlocking": {
"type": "palladium:item_buyable",
"ingredient": "minecraft:diamond",
"amount": 3
}
"unlocking": {
"type": "palladium:item_buyable",
"ingredient": "#minecraft:planks",
"amount": 3
}

palladium:score_buyable

The ability starts locked. The player must click it in the power screen and have enough points on a scoreboard objective, which are subtracted on purchase.

FieldTypeDefaultDescription
objectiveStringRequired. Name of the scoreboard objective.
amountPositive Integer1Score points consumed on purchase.
iconIconRequired. Icon shown on the buy screen.
descriptionText ComponentRequired. Label shown on the buy screen (e.g. "Skill Points").
requiresCondition(s)Optional additional conditions. Once unlocked/purchased, these conditions need to be fulfilled for the ability to be unlocked.
"unlocking": {
"type": "palladium:score_buyable",
"objective": "skill_points",
"amount": 10,
"icon": "minecraft:experience_bottle",
"description": "Skill Points"
}

Enabling Handlers

Enabling determines whether the ability is currently active. An unlocked but disabled ability has no effect.

Condition shorthand

Passing a list of conditions directly is a shorthand for palladium:conditional. This covers the majority of unlocking use cases.

"unlocking": [
{ "type": "palladium:has_effect", "effect": "minecraft:strength" },
{ "type": "palladium:crouching" }
]

palladium:conditional

Enables the ability automatically whenever a condition holds. Evaluated every tick.

FieldTypeDefaultDescription
conditionsCondition(s)Required. The condition(s) that must be true for the ability to be active.
"enabling": {
"type": "palladium:conditional",
"conditions": { "type": "palladium:has_effect", "effect": "minecraft:strength" }
}
"enabling": {
"type": "palladium:conditional",
"conditions": [
{ "type": "palladium:has_effect", "effect": "minecraft:strength" },
{ "type": "palladium:crouching" }
]
}

palladium:key_bind

Enables the ability in response to a player key press. The exact behavior depends on the behaviour field.

FieldTypeDefaultDescription
key_bindKey Bind Typepalladium:ability_keyWhich key triggers this handler.
behaviourBehaviouractionHow the key press maps to the enabled state.
cooldownTime (ticks or "Xs")0Cooldown after each activation. 0 = no cooldown.
timeTime (ticks or "Xs")0Only used with activation behaviour. Determines how long the ability stays active after a press.
"enabling": {
"type": "palladium:key_bind",
"key_bind": { "type": "palladium:ability_key" },
"behaviour": "toggle",
"cooldown": 20
}

Behaviour

ValueDescription
actionThe ability activates for one tick when the key is pressed. Supports cooldown.
toggleEach press switches the ability on or off.
heldThe ability is active only while the key is held down. Supports cooldown (maximum time it can be held).
activationThe key starts a timed activation. The ability stays enabled for time ticks, then enters cooldown before it can be triggered again.

Key Bind Types

palladium:ability_key (default)

The dedicated Palladium ability keybind (configurable by the player in the controls menu). No extra fields.

"key_bind": { "type": "palladium:ability_key" }

Since this is the default, it can be omitted entirely from the handler.

palladium:jump

Triggers on the player's jump key.

FieldTypeDefaultDescription
cancel_jumpBooleanfalseWhen true, the jump action itself is suppressed while this handler is active.
"key_bind": {
"type": "palladium:jump",
"cancel_jump": true
}
palladium:mouse_click

Triggers on a mouse button press.

FieldTypeDefaultDescription
click_typeleft_click | right_click | middle_clickRequired. Which mouse button to listen to.
cancel_interactionBooleanfalseWhen true, the normal click interaction (attack / use) is suppressed.
"key_bind": {
"type": "palladium:mouse_click",
"click_type": "right_click",
"cancel_interaction": true
}

Examples

Always unlocked, enabled by toggle key

"state": {
"enabling": {
"type": "palladium:key_bind",
"behaviour": "toggle"
}
}

Buy with XP, then hold jump to activate

"state": {
"unlocking": {
"type": "palladium:experience_level_buyable",
"xp_level": 10
},
"enabling": {
"type": "palladium:key_bind",
"key_bind": { "type": "palladium:jump", "cancel_jump": true },
"behaviour": "held"
}
}

Condition-based unlock, condition-based enable

"state": {
"unlocking": [ { "type": "palladium:has_power", "power": "test:parent_power" } ],
"enabling": [ { "type": "palladium:sneaking" } ]
}

Action with cooldown (right-click shoots, 2 second cooldown)

"state": {
"enabling": {
"type": "palladium:key_bind",
"key_bind": { "type": "palladium:mouse_click", "click_type": "right_click", "cancel_interaction": true },
"behaviour": "action",
"cooldown": 40
}
}