Skip to main content
Version: 26.1+

Automations

Automations are JSON-driven event handlers that run a list of Actions whenever a vanilla advancement criterion trigger fires, optionally gated behind a Condition.

Files are loaded from data/<namespace>/palladium/automation/.

Structure

FieldTypeRequiredDescription
triggerCriterion objectYesThe advancement criterion trigger that fires this automation
conditionConditionNoOptional condition that must pass for the actions to run (defaults to true)
actionsAction or list of ActionsYesThe actions to execute when the trigger fires and the condition passes

The trigger field follows the same format as a criterion entry in a vanilla advancement: an object with a trigger key (the trigger's ID) and an optional conditions key for filtering.

Example

Run a command whenever the player gains the mymod:super_strength power:

{
"trigger": {
"trigger": "palladium:power_gained",
"conditions": {
"power": "mymod:super_strength"
}
},
"actions": {
"type": "palladium:run_command",
"command": "say I just gained super strength!"
}
}

With an additional condition and multiple actions:

{
"trigger": {
"trigger": "palladium:ability_enabled",
"conditions": {
"ability": "mymod:flight_power#flight_ability"
}
},
"condition": {
"type": "palladium:crouching"
},
"actions": [
{
"type": "palladium:run_command",
"command": "playsound minecraft:entity.firework_rocket.launch master @s"
},
{
"type": "palladium:run_command",
"command": "particle minecraft:cloud ~ ~1 ~ 0 0 0 0.1 20"
}
]
}

Available Triggers

Palladium provides the following built-in criterion triggers for use in automations (and advancements):

TriggerDescription
palladium:power_gainedFires when the player gains a power. Accepts an optional power filter (power ID).
palladium:power_lostFires when the player loses a power. Accepts an optional power filter (power ID).
palladium:ability_enabledFires when an ability gets enabled. Accepts an optional ability filter (power and ability ID).

Any other vanilla or modded advancement criterion trigger can also be used. A list of vanilla triggers can be found here.