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
| Field | Type | Required | Description |
|---|---|---|---|
trigger | Criterion object | Yes | The advancement criterion trigger that fires this automation |
condition | Condition | No | Optional condition that must pass for the actions to run (defaults to true) |
actions | Action or list of Actions | Yes | The 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):
| Trigger | Description |
|---|---|
palladium:power_gained | Fires when the player gains a power. Accepts an optional power filter (power ID). |
palladium:power_lost | Fires when the player loses a power. Accepts an optional power filter (power ID). |
palladium:ability_enabled | Fires 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.