Pages » Qrpg » Utils » Actions


Custom Actions Engine

Allows you to create custom effects and actions on item usage and in other cases.
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'
    target-selectors:
      # Custom target selector name. Used in 'action-executors' to define the action target.
      any:
      - '[RADIUS] ~distance: 20; ~allow-self: false; ~entity-type: pig;'
      self:
      - '[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; ~entity-type: zombie;
[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;
[HOOK] Hooks target to the executor.
  • Delay
  • Target
[HOOK] ~target: pigs;
[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;
[SOUND] Plays sound to the target.
  • Delay
  • Target
  • Name
[SOUND] ~name: ENTITY_WOLF_AMBIENT; ~target: around;
[TAKE_MANA] Attempt to consume target's mana from the class plugin specified in engine.yml.
  • Delay
  • Target
  • Amount
[TAKE_MANA] ~amount: 10; ~target: self;
[TAKE_MANA] ~amount: 20%; ~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.

Prefix Description Parameters Usage Example
[ENTITY_LEVEL] Validates entity level. Level value will be taken from player/mob class plugin specified in engine.cfg
  • Amount
  • Target
  • Message
[ENTITY_LEVEL] ~amount: >5; ~target: self;
[ENTITY_LEVEL] ~amount: <10; ~target: mob;
[ENTITY_LEVEL] ~amount: =1; ~target: mob;
[VAULT_BALANCE] Validates target player balance. You must have economy plugin installed.
  • Amount
  • Target
  • Message
[VAULT_BALANCE] ~amount: >100; ~target: self;
[VAULT_BALANCE] ~amount: <100; ~target: self;
[VAULT_BALANCE] ~amount: =0; ~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;
entity-health You can use '>', '<' or '='. You can add '%' to check the current health of max. health. You can use decimal numbers. ~entity-health: 100%;
~entity-health: <25%;
~entity-health >0;
entity-type Defines the entity type for target selector. If no type provided, target selector will select any entity type. You can provide multiple types. ~entity-type: pig;
~entity-type: player,zombie,villager;
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;
party-member Defines if the target player should be a member of the executor's party. If executor is not a player, or not in the party, this paramter will be skipped. ~party-member: true;
~party-member: false;
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;

Information
Empty Block

18+