Actions
Action allows server owner to do action when an event is triggered.
Actions are stored under the /plugins/FancyWaystones/actions
directory. You can create your own action YAML file or modify the existing ones.
Configuration Structure
Enable: [true (default)|false]
Event: [event name]
Ignore Cancelled: [true|false (default)]
Action: [action]
Enable: Whether this action is enabled or not. Disabled events are not triggered!
Event: The event name you want this action to be triggered on.
Ignore Cancelled: Whether this action should be triggered if the event is cancelled by other action or 3rd party plugin. If this is true, the action will trigger anyway even if the event is cancelled.
Action: The action itself, what to do on this situation. See configuration structure below.
The Action
CANCEL_EVENT
Cancel the event, preventing the plugin from doing the task (i.e. cancelling WaystoneTeleportEvent will prevent the player from teleporting).
Type: CANCEL_EVENT
STOP
Stop the action from doing any further action (in the file).
Type: STOP
CONSOLE_COMMAND
Executes command as console
Type: CONSOLE_COMMAND
Command: "give {player_name} diamond 1"
COMMAND
Execute command as the player whose involved in the event (e.g. the player that is about to teleport in WaystoneTeleportEvent).
Type: COMMAND
Command: "say i'm teleporting! good bye!"
CANCEL_AND_STOP
Mark the event cancelled, and stop the action from doing any further action (in the file).
Type: CANCEL_AND_STOP
COMPOUND
Executes a list of actions.
Type: COMPOUND
Actions:
- Type: COMMAND
Command: "say this command is executed first"
- Type: COMMAND
Command: "say this command is executed second"
- Type: COMPOUND
Actions:
- Type: COMMAND
Command: "say you can put COMPOUND in another COMPOUND!"
UNCANCEL_EVENT
Mark event as un-cancelled.
Type: UNCANCEL_EVENT
CONDITIONAL
Execute action if the condition is true or false
Type: CONDITIONAL
Condition:
Criteria: HAS_PERMISSION
Permission: "iam.vip"
If True:
Type: COMMAND
Command: "say i am vip"
If False:
Type: CONDITIONAL
Criteria: IS_CANCELLED
If True:
Type: UNCANCEL_EVENT
MESSAGE
Send message to the player (or console if no player is involved).
Type: MESSAGE
Message: "Hello, {player_name}"
DELAYED
Delay executing an action.
Type: DELAYED
Delay: "5m 15s"
Action:
Type: MESSAGE
Message: "This action is executed after 5 minutes and 15 seconds"
Example
Enable: true
Event: WaystoneBreakEvent
Ignore Cancelled: false
Action:
Type: COMPOUND
Actions:
- Type: COMMAND
Command: "say I broke a waystone!"
- Type: CONSOLE_COMMAND
Command: "minecraft:give {player_name} minecraft:diamond 1"
- Type: CONDITIONAL
Condition:
Criteria: HAS_PERMISSION
Permission: "waystone.break.notify"
If True:
Type: COMMAND
Command: "say {player_name} has permission to break waystones!"
If False:
Type: COMMAND
Command: "say {player_name} does not have permission to break waystones!"
- Type: COMPOUND
Actions:
- Type: COMMAND
Command: "say This is the first command in a compound action."
- Type: CONDITIONAL
Condition:
Criteria: HAS_PERMISSION
Permission: "waystone.break.reward"
If True:
Type: CANCEL_EVENT
If False:
Type: STOP
- Type: MESSAGE
Message: "You have broken a waystone!"
- Type: DELAYED
Delay: 1s
Action:
Type: COMMAND
Command: "say This command is executed after a delay of 1 second."
Last updated