"To" Actions

These are special tags that allows you to execute the action to a certain group of users. These tags need to be added before the action.

TO ALL

It will execute the action for all players on the server. Use this format: "to_all: <action>"

- 'to_all: message: &a%player% just leveled up!'
- 'to_all: message: &7Hello &a%to:player% &7your level is &a%to:player_level%&7!'

TO TARGET

This is a special action for player_attack ,player_kill and entity_interact events. It will execute the action for the target of the event. Use this format: "to_target: <action>"

 - 'to_target: give_potion_effect: POISON;120;1'
 - 'to_target: message: &cYou were poisoned by &e%player%&c!'

TO WORLD

It will execute the action for all players in a world. Use this format: "to_world: <world>: <action>"

- 'to_world: spawn: message: &6This message is sended to all players in the SPAWN world.'
- 'to_world: %player_world%: message: &6Hello to this world!'

TO RANGE

It will execute the action for all players inside a certain radius of blocks. You can decide whether to include the player involved in this event or not. Use this format: "to_range: <radius>;<include_player>: <action>"

- 'to_range: 10;true: message: &6This message is sended to all players in a radius of 10 blocks!'
- 'to_range: 10;false: message: &6%player% says: &7Hello %to:player%!'

TO PLAYER

It will execute the action for a certain player. Use this format: "to_player: <player>: <action>"

to_player: %arg_1%: message: &d[PM] &8[&e%player% -> &eYou&8]&7: &f%args_substring_2-99%

Full Example

example:
    type: player_command
    conditions:
    - "%main_command% == /message"
    - "%args_length% < 2 execute error1"
    - "%parseother_{arg_1}_{player_online}% == no execute error2"
    actions:
      default:
      - "cancel_event: true"
      - "message: &d[PM] &8[&eYou &7-> &e%arg_1%&8]&7: &f%args_substring_2-99%"
      - "to_player: %arg_1%: message: &d[PM] &8[&e%player% -> &eYou&8]&7: &f%args_substring_2-99%"
      error1:
      - "cancel_event: true"
      - "message: &cYou must use &7/message <player> <text>"
      error2:
      - "cancel_event: true"
      - "message: &cThat player is not online."

This is an example of a private message system. When the player uses the /message <player> <text> command, and the selected player is online, a message will be sent to that player and the one using the command.

TO CONDITION

It will execute the action for all the players that accomplish certain conditions. It is necessary to have previously defined a condition group in the config, as show below:

Config:
  to_condition_groups:
    group1:
    - "%player_world% == spawn"
    group2:
    - ...
    group3:
    - ...

You can create multiple to condition groups following the same format as the usual conditions, excluding the "execute" option.

Next, you can use the previously created condition group "group1" in a to_condition action using the following format: "to_condition: <group>: <action>"

to_condition: group1: message: &7This message will be received by anyone who accomplish the <group1> condition

Full Example

Config:
  to_condition_groups:
    group1:
    - "%player_has_permission_conditionalevents.somepermission% == yes"
test:
    type: player_command
    conditions:
    - "%command% == /test"
    actions:
      default:
      - "cancel_event: true"
      - "to_condition: group1: message: &7Hello to people with permissions."

The previous event adds a /test command that will send a message ONLY to the players that have the conditionalevents.somepermission permission.

Last updated