The action system offers pre-set effects provided by the plugin. However, you can also add your own actions by using the API. This system can be applied anywhere an action can be triggered, like when you break a crop, interact a pot etc.
Action is composed of three parts
type:The action typevalue:The arguments of the actionchance:Optional (0~1 Default:1)
If the value is an integer or a double value, you can use expression for instance
exp_action:type:expvalue:'{level} * 3'
Here's an example that combines the conditions and actions. In this example, if you interact the ripe crop with empty hand, it would be harvested. If you interact it with a seed, it would be replanted.
events:interact:action_1:type:conditionalvalue:conditions:# require both hands to be emptyrequirement_1:type:item-in-handvalue:item:"AIR"requirement_2:type:item-in-handvalue:hand:otheritem:"AIR"actions:action_1:type:breakvalue:trueaction_2:type:swing-handvalue:trueaction_2:type:conditionalvalue:conditions:requirement_1:type:item-in-handvalue:item:"customcrops:tomato_seeds"amount:1actions:action_1:type:breakvalue:trueaction_2:type:swing-handvalue:trueaction_3:type:plantvalue:crop:tomatopoint:0action_4:type:item-amountvalue:-1
Action Library
message (Send a message to player)
messages_action:type:messagevalue: - '<#FF4500>[1st] Congratulations! You got the first prize!'
broadcast (Send a message to online players)
broadcast_action:type:broadcastvalue: - 'Hello!'
command (Execute a console command)
command_action:type:commandvalue: - 'money give {player} 200'
delay_action:type:delayvalue:delay:20# in ticksasync:false# whether to run asynchronouslyactions:action_1:...action_2:...
timer
timer_action:type:timervalue:async:false# whether to run asynchronouslyduration:20# in ticksdelay:3# in ticksperiod:2# in ticksactions:action_1:...action_2:...
hologram (Display a hologram for some time)
hologram_action:type:hologramvalue:duration:20text:'{water_bar}'apply-correction:true# apply height corrections on each cropvisible-to-all:false# decides if the hologram can be seen by all the playersrange:32# decides the visible rangey:2x:0z:0
plant_action:type:plantvalue:crop:tomato# The config IDpoint:0
break
break_action:type:breakvalue:true# whether to trigger "break" event
particle
particle_action:type:particlevalue:particle:FLAMEx:0.5y:0.5z:0.5count:10offset-x:0.5offset-y:0.5offset-z:0.5extra:0.0# Only works if particle is ITEM_CRACKitemStack:customcrops:xxx# Only works if particle is REDSTONE/DUST_COLOR_TRANSITIONcolor:255,0,0scale:1# Only works if particle is DUST_COLOR_TRANSITIONto-color:0,0,255
give-money
money_action:type:give-moneyvalue:100.12
take-money
money_action:type:take-moneyvalue:50.54
title
title_action:type:titlevalue:title:'<green>Hello!</green>'subtitle:'This is the subtitle!'fade-in:20stay:30fade-out:10