You can set the same action multiple times. You just have to add _anything at the end.
For example if you want to play two sounds you have to write this:
Every action has a special attribute permission.
It's the permission the player must have before starting the action.
For example the player must have myitems.usage.secret_items_dispenser permission to play the sound.
NOTE: In this example you will notice an issue.
The sound is played even if the user has no permission for the give event. That's because permission check is only on the give_item.
Use the official files editor to get the complete list while working on your configurations.
Flow customization
The plugin allows you to further customize your actions by avoiding their execution in some specific cases explained in the next lines.
This allows further customization of your items logic.
For example you can create a wand which plays specific sound only if a mob was successfully attacked and which plays another sound in case of failed attack.
Magic wand example code (click to expand)
info:
namespace: actions_flow_test
items:
magic_wand:
display_name: Test Magic Wand
resource:
generate: false
model_path: minecraft:item/stick
material: STONE_SWORD
events:
interact_mainhand:
left:
# Damage the entity in sight
damage_entity_in_sight:
damage: 1
distance: 8
# Decrement durability only if the attack is successful
decrement_durability:
amount: 1
flow:
skip_if_fail: damage_entity_in_sight
# Play sound only if the attack is successful
play_sound:
name: block.amethyst_cluster.step
volume: 1.5
pitch: 1
flow:
skip_if_fail: damage_entity_in_sight
# Play sound only if the attack is successful
shoot_particle:
name: CRIT_MAGIC
distance: 7
flow:
skip_if_fail: damage_entity_in_sight
# Play sound only if the attack is failed
play_sound_fail:
name: minecraft:block.wool.break
volume: 1
pitch: 2
flow:
skip_if_success: damage_entity_in_sight
# Play sound only if the attack is failed
shoot_particle_fail:
name: CRIT
distance: 7
flow:
skip_if_success: damage_entity_in_sight
Flow rules
stop_if_last_success
Doesn't execute this and the next actions if the previous action succeeded.
stop_if_last_fail
Doesn't execute this and the next actions if the previous action failed.
skip_if_last_success
Doesn't execute this action if the previous action succeeded.
skip_if_last_fail
Doesn't execute this action if the previous action failed.
stop_if_any_success
Doesn't execute this and the next actions if ANY of the previous actions succeeded.
stop_if_any_fail
Doesn't execute this and the next actions if ANY of the previous actions failed.
skip_if_any_success
Doesn't execute this action if ANY of the previous actions succeeded.
skip_if_any_fail
Doesn't execute this action if ANY of the previous actions failed.
stop_if_success
Doesn't execute this and the next actions if a specific previous action succeeded.
stop_if_fail
Doesn't execute this and the next actions if a specific previous action failed.
skip_if_success
Doesn't execute this action if a specific previous action succeeded.
skip_if_fail
Doesn't execute this action if a specific previous action failed.
Special properties
execute_commands has a special property called flow_success_if_message_contains.
This allows you to identify when a console command didn't fail, for example if the player was teleported successfully, if the block was set etc.
The plugin normally can automatically identify success/fail of vanilla commands but not of plugins commands, so you might use this setting to identify if a command of a plugin failed.
For example you can set it to "failed to teleport" to identify if a teleport command failed (this is just an example).
Using vanilla execute if
In some cases you might want to do some specific checks on scoreboard, blocks and similar using the vanilla /execute if command.
Examples
This item makes the player teleport 2 blocks up only if the example_score value is 0.
This item sets the block at ~ ~-1 ~ to stone.
"Successfully set block!" message is printed if the command status is success.
The message is completely skipped if the command status is fail.
This item will execute a plugin command.
The plugin can't automatically identify plugins commands success/fail status, so you have to specify a text that can help the plugin to identify the command status.
For example I check if the result text contains "Given item" in order to know if the command was executed successfully.