Other Events

ENTITY INTERACT

Event called when a player right clicks an entity.

example:
  type: entity_interact
  conditions:
  - '%entity% == PLAYER'
  - '%player_is_sneaking% == yes'
  actions:
    default:
    - "player_command: trade %target:player_name%"

Variables:

  • ConditionalEvents entity variables (for clicked entity)

  • ConditionalEvents item variables (for item in hand)

On this event you can use target player variables and to_target actions.

ENTITY SPAWN

Event called when an entity (animal or monster) is going to spawn.

example:
  type: entity_spawn
  conditions:
  - '%entity% == WITHER'
  - '%entity_world% == survival'
  actions:
    default:
    - "cancel_event: true"

Variables:

This is not a player event, which means you can't use player variables or player actions.

CONSOLE COMMAND

Event called when the console executes a command.

example:
  type: console_command
  conditions:
  - '%command% startsWith addperm'
  actions:
    default:
    - 'cancel_event: true'
    - 'console_command: lp group %arg_1% permission set %arg_2%'

Variables:

  • %command% (The full command the console used)

  • %main_command% (The main command without arguments)

  • %arg_X% (The argument in the X position of the command. If the command is announce hello world the %arg_1% variable would be "hello" and the %arg_2% would be "world")

  • %args_length% (The amount of arguments of the command)

  • %args_substring_<arg1>-<arg2>% (This variable will create a text using a first argument and a last argument. For example, if the command is announce I am currently doing a Youtube livestreaming, you could use the %args_substring_1-6% variable to take arg1, arg2,...,arg6 and get the text that the player is announcing. If you don't care about the arguments length, instead of 6 use a large number like 100)

This is not a player event, which means you can't use player variables or player actions.

SERVER START

Event called when the server starts and the plugin is enabled.

example:
  type: server_start
  actions:
    default:
    - "console_command: ce enable event1"

This event has no variables, but you can still use ConditionalEvents variables or PlaceholderAPI variables.

This is not a player event, which means you can't use player variables or player actions.

SERVER STOP

Event called when the server stops and the plugin is disabled.

example:
  type: server_stop
  actions:
    default:
    - "to_all: message: &c&lCLOSING SERVER, WE ARE BACK SOON."

This event has no variables, but you can still use ConditionalEvents variables or PlaceholderAPI variables.

This is not a player event, which means you can't use player variables or player actions.

REPETITIVE

The repetitive event works by checking for conditions for each player periodically. The time is defined in the repetitive_time option. This option defines the period of time in TICKS (20 ticks = 1 second) when checking the conditions.

example:
  type: repetitive
  repetitive_time: 10
  conditions:
  - '%player_world% == plotworld'
  - '%player_gamemode% != CREATIVE'
  actions:
    default:
    - 'gamemode: CREATIVE'
    - 'actionbar: &6Changing gamemode to creative.;100'

This event has no variables, but you can still use ConditionalEvents variables or PlaceholderAPI variables.

REPETITIVE SERVER

The repetitive server event works by checking for conditions of the server periodically (like local time, but no player variables). The time is defined in the repetitive_time option. This option defines the period of time in TICKS (20 ticks = 1 second) when checking the conditions.

example:
  type: repetitive_server
  repetitive_time: 1200
  actions:
    default:
    - 'to_all: message: &7There are &a%server_online% &7players on the server.'

This event has no variables, but you can still use ConditionalEvents variables or PlaceholderAPI variables.

This is not a player event, which means you can't use player variables or player actions.

CALL

The call event is a special event that will be executed ONLY from the actions of another event (using the call_event action), or using the /ce call command.

example:
    type: player_command
    conditions:
    - "%main_command% == /test"
    actions:
      default:
      - "cancel_event: true"
      - "message: This is a test message from event 'example'"
      - "call_event: example2"
example2:
    type: call
    actions:
      default:
      - "message: This message will be sent only when event 'example2' is called"

This means you can now check for conditions after actions execution, using a complementary call event. You can also pass variables from an event to another to make it more specific.

example:
    type: player_command
    conditions:
    - "%main_command% == /test"
    actions:
      default:
      - "cancel_event: true"
      - "message: This is a test message from event 'example'"
      - "call_event: example2;%example_variable%=Something"
example2:
    type: call
    conditions:
    - "%example_variable% == Something"
    actions:
      default:
      - "message: This message will be sent only when event 'example2' is called"

This event has no variables, but you can still use ConditionalEvents variables or PlaceholderAPI variables. Remember that a call event can be executed passing some variables from another event.

This event will be a player event if the original event which was called from is a player event.

CUSTOM

Any custom event that you want. You can use events from other plugins, more info on the Custom Events page.

Last updated