info:namespace:actions_flow_testitems:magic_wand:display_name:Test Magic Wandresource:generate:falsemodel_path:minecraft:item/stickmaterial:STONE_SWORDevents:interact_mainhand:left:# Damage the entity in sightdamage_entity_in_sight:damage:1distance:8# Decrement durability only if the attack is successfuldecrement_durability:amount:1flow:skip_if_fail:damage_entity_in_sight# Play sound only if the attack is successfulplay_sound:name:block.amethyst_cluster.stepvolume:1.5pitch:1flow:skip_if_fail:damage_entity_in_sight# Play sound only if the attack is successfulshoot_particle:name:CRIT_MAGICdistance:7flow:skip_if_fail:damage_entity_in_sight# Play sound only if the attack is failedplay_sound_fail:name:minecraft:block.wool.breakvolume:1pitch:2flow:skip_if_success:damage_entity_in_sight# Play sound only if the attack is failedshoot_particle_fail:name:CRITdistance:7flow:skip_if_success:damage_entity_in_sight
test_flow_setblock:enabled:truedisplay_name:test_flow_setblockresource:generate:falsemodel_path:minecraft:item/diamondmaterial:DIAMONDevents:interact:right:execute_commands:cause_command:command:'execute at {player} run setblock ~ ~-1 ~ stone'as_console:trueexecute_commands_2:effect_command:command:'tellraw {player} {"text": "Successfully set block!"}'as_console:trueflow:skip_if_fail:execute_commands
这个物品会执行一个插件指令。
插件无法自动识别插件命令的成功/失败状态,因此你必须指定一个文本来帮助插件识别命令状态。
例如我要检查结果文本是否包含 Given item 以获知指令是否成功执行。
test_flow_plugin_command:enabled:truedisplay_name:test_flow_plugin_commandresource:generate:falsemodel_path:minecraft:item/diamondmaterial:DIAMONDevents:interact:right:execute_commands:cause_command:command:'iagive {player} iasurvival:end_ore'as_console:trueflow_success_if_message_contains:"Given item"execute_commands_2:effect_command:command:'tellraw {player} {"text": "Okay successfully given item!"}'as_console:trueflow:skip_if_fail:execute_commands