Page cover image

Actions

On this page you will learn how to create and configure actions that will be executed upon certain events, such as a player teleporting.

You can set actions to run on certain DeluxeTeleport events. See each feature's settings to learn how you can use them.

actions:
  action1:
    type: message
    enabled: true
    when: none
    message: "Example of action"

You can also set up conditions within actions so that they are executed only if a certain condition is met. See the documentation on conditions [HERE].

actions:
  action1:
    type: message
    enabled: true
    when: none
    message: "Example of action"
    conditions:
      minimum_requirements: 1
      conditions:
        condition1:
          type: has permission
          permission: deluxeteleport.permission
          enabled: true
          optional: false
          succes_actions:
            actions: []
          deny_actions:
            actions: []  

General values

These values ​​apply to all actions and some are required for it to work.

Value
Description
Mandatory

type

The type of action to perform.

enabled

Yes, this action will be enabled (default true)

when

When is this action performed?

whom

This indicates who the actions are executed on (for tpa only).

conditions

Conditions for executing the action. See the documentation [HERE].

Values ​​for when

Esto indica cuándo se ejecuta la acción.

Value
Description

none

Plays when the player is teleported, whether or not they have delay.

before_delay

It is executed when the delay starts.

during_delay

It runs every second during the delay.

after_delay

It is executed when the delay ends (when the player is teleported).

cancel_delay

It is executed when the teleport has been cancelled (usually by movement).

You can use multiple values ​​in the same action, just separate them by , .

Example:

when: none, after_delay

Values ​​for whom

This indicates who the actions are executed on (for tpa only).

Value
Description

player

This is the player who sends the teleport request.

target_player

This is the player who receives the teleport request.

both

This indicates both players.

Player Command

Sends a command as if it were executed by the player.

type: command
command: "TEXT"

Example:

type: command
command: "home %home_name%"

Console command

Send a command from the console.

type: console
command: "TEXT"

Example:

type: console
command: "give %player_name% diamond 1"

Sound

Sends a sound to the player.

type: sound
sound: "TEXT"
volume: 1
pitch: 1

Example:

type: sound
sound: ENTITY_PLAYER_LEVELUP
volume: 0.8
pitch: 1

Message

Send a message to the player in chat.

type: message
message: "TEXT"

Example:

type: message
message: "&aSample message, &#ff5733message in HEX (v1.16+)"

Centered Message

Send a chat centered message to the player.

type: centeredmessage
message: "TEXT"

Example:

type: message
message: "&aSample message, &#ff5733message in HEX (v1.16+)"

Broadcast

Send a message to all online players.

type: broadcast
message: "TEXT"

Example:

type: message
message: "&e%player_name% went to spawn."

Title

Sends a title to the player's screen.

type: title
title: "TEXT"
subtitle: "TEXT"
fadeIn: 10t # Time it takes for the title to fade in.
stay: 3s 10t # Time to be displayed on screen.
fadeOut: 1s # Time it takes for the title to fade out.

Example:

type: title
title: "&#ff5733Welcome to spawn"
subtitle: "&7safe zone"
fadeIn: 10t
stay: 3s 10t
fadeOut: 1s

Gamemode

Switches the player to game mode (gamemode: SURVIVAL, ADVENTURE, CREATIVE, SPECTATOR).

type: gamemode
gamemode: MODE

Example:

type: gamemode
gamemode: ADVENTURE

Potion Effect

Grants a potion effect to the player.

type: potioneffect
effect: EFFECT
duration: 5s
amplifier: 0 # Effect level (0 for base level)

Example:

type: potioneffect
effect: NIGTH_VISION
duration: 5s
amplifier: 0

Actionbar

Sends a message in the player's action bar.

type: actionbar
message: "TEXT"
duration: 3s

Example:

type: actionbar
message: "&aTeleport in &b%spawn_delay_formatted%&a..."
duration: 3s

Last updated

Was this helpful?