Complete project: one ability using Actions, Conditions and Triggers
Three independent systems cooperate: Condition checks eligibility, Action defines effects, Trigger listens for an event and invokes the Action. A saved Action does not run on its own.
1. Prerequisites
Keep the official obsidrel:ruby item from resources/items/example.yml loaded. Create three YAML files.
resources/conditions/magic.yml: level gate
magic_level:
enabled: true
type: LEVEL
operator: '>='
value: 10
message: '<red>Level 10 required.</red>
resources/actions/magic.yml: effects and gate
ruby_magic:
enabled: true
conditions: [magic_level]
failure-message: '<red>Reach level 10 first.</red>'
steps:
message:
type: MESSAGE
message: '<green>Energy released!</green>'
sound:
type: SOUND
sound: 'minecraft:block.note_block.pling'
volume: 1.0
pitch: 1.25
particles:
type: PARTICLE
particle: END_ROD
count: 12
offset-x: 0.2
offset-y: 0.3
offset-z: 0.2
speed: 0.02
resources/triggers/magic.yml: right click
magic_click:
enabled: true
event: ITEM_USE
target: obsidrel:ruby
item-trigger: RIGHT_CLICK
cancel-event: false
actions: [ruby_magic]
2. Advanced: composite requirement
The Core supports ALL (both) and OR (either). Require level and permission:
double_gate:
enabled: true
type: ALL
conditions:
level:
type: LEVEL
operator: '>='
value: 10
permission:
type: PERMISSION
permission: obsidrel.magic.use
Set the Action to conditions: [double_gate]. You may add GIVE_ITEM for AMETHYST_SHARD or VAR_ADD to increment player data. Consider Cooldowns to avoid unlimited rewards.
3. Integrations and limitations
Actions support conditions, failure-message and step-specific conditions. Triggers support conditions, actions, event, target. UI buttons can run [action] name. Do not add actions blindly to recipes, blocks or furniture: each loader has its own supported keys.
4. Verify
Save all three files, run /obsidrel reload, test below and above level 10. Inspect IDs, held item, trigger event, permissions and logs. Add effects incrementally.
References: Actions, Conditions, Triggers.