Pages » Sunlight » Utils » Actions


Custom Actions Engine

Allows you to create custom effects and actions.
PlaceholderAPI is fully supported here.


Config Example

# Actions Engine starts here.
# (!) Every Action Parameter name MUST starts with '~' and ends with ':'
# (!) Parameter value MUST ends with ';'
actions:
  # Your custom actions section name. Must be unique.
  # You can create many sections with different actions and then switch between them.
  default:
    # Defines the targets for 'action-executors'
    # Each target selector MUST HAVE 'name' parameter that defines the name of target selector to use it in Actions and Conditions!
    # You can have multiple target selectors with the same 'name' parameter.
    target-selectors:
      # Custom target selector name. Used in 'action-executors' to define the action target.
    - '[RADIUS] ~name: any; ~distance: 20; ~allow-self: false;'
    - '[SELF] ~name: self;'
    # List of conditions that are required for actions to be executed.
    conditions:
      list: []
      # Name of the actions section (see above, like 'default') where it will jump when condition checks are failed.
      # You can set non-existent section name to interrupt the next actions.
      actions-on-fail: 'null'
    # Executes the specified actions with custom parameters.
    action-executors:
    - '[COMMAND_CONSOLE] ~message: smite %target%; ~target: any;'
    - '[PROJECTILE] ~name: SHULKER_BULLET; ~target: any; ~speed: 3.5;'
    - '[PARTICLE_LINE] ~offset: 0.1,0,0.1; ~speed: 0; ~name: FLAME; ~target: any; ~amount: 50;'
    - '[POTION] ~name: JUMP; ~amount: 2; ~duration: 200; ~target: any;'
    - '[BURN] ~duration: 0; ~target: any;'
    - '[SOUND] ~name: ENTITY_WOLF_AMBIENT; ~target: any;'


Target Selectors


Prefix Description Parameters Usage Example
[FROM_SIGHT] Selects the target from executor's sight.
  • Distance
  • Allow Self
  • Attackable
  • Entity Type
  • Entity Health
  • Party Member
[FROM_SIGHT] ~distance: 25;
[RADIUS] Selects the target within specified radius from executor.
  • Distance
  • Allow Self
  • Attackable
  • Entity Type
  • Entity Health
  • Party Member
[RADIUS] ~distance: 5; ~attackable: true; ~allow-self: false;
[SELF] Selects the executor as a target.
  • Entity Health
  • Party Member
[SELF] ~entity-health: >50%; ~party-member: false;

Action Executors


Prefix Description Parameters Usage Example
[ACTION_BAR] Sends message to target's action bar.
  • Delay
  • Target
  • Message
[ACTION_BAR] ~message: &aHello, %executor%!; ~target: self;
[BROADCAST] Broadcasts the message.
  • Delay
  • Message
[BROADCAST] ~message: &aHello everyone!;
[BURN] Burns the target.
  • Delay
  • Target
  • Duration
[BURN] ~duration: 100; ~target: pigs;
[COMMAND_PLAYER] Executes a command by action executor.
  • Delay
  • Target
  • Message
[COMMAND_PLAYER] ~message: smite %target%; ~target: players;
[COMMAND_CONSOLE] Executes a command by console.
  • Delay
  • Target
  • Message
[COMMAND_CONSOLE] ~message: smite %target%; ~target: players;
[COMMAND_OP] Executes a command by action executor as OP.
  • Delay
  • Target
  • Message
[COMMAND_OP] ~message: smite %target%; ~target: players;
[DAMAGE] Damages the target.
  • Delay
  • Target
  • Amount
[DAMAGE] ~amount: 10; ~target: pigs; - Will do additional 10 damage + executor's damage.
[DAMAGE] ~amount: 50%; ~target: all; - Will do 50% of executor's damage.
[FIREWORK] Launch firework at the target location.
  • Delay
  • Target
[FIREWORK] ~target: self; ~delay: 20;
[HEALTH] Changes target's health.
  • Delay
  • Target
  • Amount
[HEALTH] ~amount: 10%; ~target: self;
[HEALTH] ~amount: -10; ~target: self;
[HOOK] Hooks target to the executor.
  • Delay
  • Target
[HOOK] ~target: pigs;
[HUNGER] Changes target's food level.
  • Delay
  • Target
  • Amount
[HUNGER] ~amount: 10%; ~target: self;
[HUNGER] ~amount: -10; ~target: self;
[MESSAGE] Sends message to target.
  • Delay
  • Target
  • Message
[MESSAGE] ~message: &cYo, %target%; ~target: players;
[LIGHTNING] Summons lightning at the target location.
  • Delay
  • Target
[LIGHTNING] ~target: pigs;
[PARTICLE_SIMPLE] Creates simple particle effect.
  • Delay
  • Target
  • Name
  • Offset
  • Speed
  • Amount
[PARTICLE_SIMPLE] ~name:REDSTONE; ~offset: 0.1,0.1,0.1; ~speed: 0.1; ~amount: 30; ~target: pigs;
[PARTICLE_LINE] Draws a particle line to the target entity or block.
  • Delay
  • Target
  • Name
  • Offset
  • Speed
  • Amount
[PARTICLE_LINE] ~name:REDSTONE; ~offset: 0,0,0; ~speed: 0; ~amount: 10;
[PARTICLE_PULSE] Creates a pulse particle around the target.
  • Delay
  • Target
  • Name
Name must be with 2 particle names: NAME1-NAME2
[PARTICLE_PULSE] ~name:REDSTONE-CRIT_MAGIC; ~target: self;
[POTION] Adds a potion effect to target.
  • Delay
  • Target
  • Name
  • Duration
  • Amount
Amount = Level
[POTION] ~name:JUMP; ~amount: 2; ~duration: 300; ~target: self;
[PROGRESS_BAR] Displays title progress bar.
  • Delay
  • Target
  • Title
  • SubTitle
  • Duration
  • Color Empty
  • Color Filled
SubTitle = Bar Symbol
[PROGRESS_BAR] ~title: &cBar; ~subtitle: •; ~color-empty: &7; ~color-fill: &c; ~duration: 200; ~target: self;
[PROJECTILE] Launch projectile to the target.
  • Delay
  • Target
  • Name
  • Speed
Name = EntityType

[PROJECTILE] ~name: ARROW; ~speed: 3.5; ~target: around;
[SATURATION] Changes target's saturation level.
  • Delay
  • Target
  • Amount
[SATURATION] ~amount: 10%; ~target: self;
[SATURATION] ~amount: -10; ~target: self;
[SOUND] Plays sound to the target.
  • Delay
  • Target
  • Name
[SOUND] ~name: ENTITY_WOLF_AMBIENT; ~target: around;
[TELEPORT] Teleports target to the specified location.
  • Delay
  • Target
  • Locatinon
[TELEPORT] ~location: world,25,10,25; ~target: self;
[TELEPORT] ~location: %executor.world%,%executor.x%,%executor.y%,%executor.z%; ~target: around;
[THROW] Throws target away from the executor.
  • Delay
  • Target
[THROW] ~target: around; ~delay: 10;
[TITLES] Sends titles to the target.
  • Delay
  • Target
  • Title
  • SubTitle
  • Fade In
  • Stay
  • Fade Out
[TITLES] ~title: &cTitle Text!; ~subtitle: &6SubTitle Text!; ~fadeIn: 10; ~stay: 50; ~fadeOut: 10; ~target: self;

Action Conditions


Every condition can have a ~message parameter that will print message if condition check fails.
Also, every condition may have a ~filter parameter that defines if targets that aren't met the conditions should be skipped (true) or if the whole action should be interrupted (false).

Prefix Description Parameters Usage Example
[VAULT_BALANCE] Checks target player balance. You must have economy plugin installed.
  • Amount
  • Target
  • Message
  • Filter
[VAULT_BALANCE] ~amount: >100; ~target: self;
[VAULT_BALANCE] ~amount: <100; ~target: self;
[VAULT_BALANCE] ~amount: =0; ~target: self;
[ENTITY_TYPE] Checks target entity type.
  • Name
  • Target
  • Message
  • Filter
[ENTITY_TYPE] ~name: zombie; ~target: self;
[ENTITY_HEALTH] Checks target entity health.
  • Amount
  • Target
  • Message
  • Filter
[ENTITY_HEALTH] ~amount: >100; ~target: self;
[ENTITY_HEALTH] ~amount: <50%; ~target: self;
[ENTITY_HEALTH] ~amount: =20; ~target: self;
[WORLD_TIME] Checks (target's) world time. If no target provided, then world name from 'name' parameter will be used. If no 'name' parameter provided, then target's world name will be used.
Time must be provided in in-game ticks.
  • Amount
  • Target
  • Name
  • Message
  • Filter
[WORLD_TIME] ~amount: >0; ~target: self;
[WORLD_TIME] ~amount: >1200; ~name: world_the_end;
[PERMISSION] Checks target's permission. You can provide negative permission node to check if target does NOT have permission.
  • Name
  • Target
  • Message
  • Filter
[PERMISSION] ~name: plugin.example.perm; ~target: self;
[PERMISSION] ~name: -do.not.have.this.perm; ~target: self;

Action and Target Parameters


Name Description Usage Example
allow-self Allows/Disallows to select the executor in target selector as a target. False by default. ~allow-self: false;
~allow-self: true;
amount Defines the object amount for specified action. Negative values are allowed. Some actions allows to use percentage values. Some actions allows to use >, <, = operators. ~amount: 10;
~amount: -5;
~amount: 20%
attackable Defines if target should be available to receive damage from the executor. This parameter only checks the WorldGuard and Residence flags and if target is a Citizens NPC. If this parameter is not provided, any entity will be selected. ~attackable: false;
~attackable: true;
delay Delay in ticks (20 ticks = 1 second), before the action will be executed. ~delay: 100;
distance Defines the distance (in blocks) from the executor to target OR distance for specified action. ~distance: 30;
duration Defines the action duration in ticks (20 ticks = 1 second). ~duration: 250;
filter Used in Conditions and defines if targets that aren't met the conditions should be skipped (true) or if the whole action should be interrupted (false). ~filter: true;
~filter: false;
location Defines the location for action.
Placeholders:
  • %executor.world%, %executor.x%, %executor.y%, %executor.z%
  • %target.world%, %target.x%, %target.y%, %target.z%
~location:world,10,20,30;
message Defines the message text.
Placeholders:
  • %executor% - Executor name
  • %target% - Target name.
~message: &aHello there!;
name Defines the object name for specified action. ~name: CLOUD;
offset Defines the object offset for specified action. Format: X,Y,Z. ~offset: 0.1,0.1,0.1;
~offset: 0,0,0;
speed Defines the object speed for specified action. ~speed: 0.5;
target Defines the target selector for action. You can provide multiple targets. Use target selector names. ~target: selector-1;
~target: pigs,cows;
title Defines the title text.
Placeholders:
  • %executor% - Executor name
  • %target% - Target name.
~title: &lHello, &f%executor%&e!;
subtitle Defines the subtitle text.
Placeholders:
  • %executor% - Executor name
  • %target% - Target name.
~subtitle: &lHello, &f%executor%&e!;
fadeIn Defines the fade in time (in ticks) for titles. ~fadeIn: 10;
stay Defines the stay time (in ticks) for titles. ~stay: 40;
fadeOut Defines the fade out time (in ticks) for titles. ~fadeOut: 10;
color-empty Defines the color for unfilled elements of progress bar. ~color-empty: &7;
color-fill Defines the color for filled elements of progress bar. ~color-fill: &a;

SunLight Action Executors


Prefix Description Parameters Usage Example
[OPEN_GUI] Opens specified GUI from GUI module.
  • Delay
  • Target
  • Name
[OPEN_GUI] ~name menu; ~target: self;

Information
Empty Block

18+