Page cover image

PlaceholderAPI

DeluxeTeleport includes PlaceholderAPI support, allowing you to use custom variables in other plugins. The available variables are not predefined; you can create them yourself in the placeholders.yml file, within the placeholders section.

How to Create Variables

Creating new variables is very simple. Simply add a new section in the file placeholders.yml. For example:

placeholders:
  example_variable: "&7%player_name%"

Personalization

Within these variables, you can use color codes using the & symbol, as well as values ​​in HEX format since version 1.16. Additionally, you can combine internal DeluxeTeleport variables and PlaceholderAPI variables.

Using Variables

Once you have created your variable, you can use it in other plugins using the following syntax:

%deluxeteleport_<name>%

For example, if you created a variable called example_variable, you would use it like this:

%deluxeteleport_example_variable%

Variables with Conditions

You can also create variables that return different values ​​depending on their result. Here's how you can create conditional variables.

Example of Creating Conditional Variables

placeholders:
  example_conditions:
    input: '%naruland_spawn_cooldown_time%'
    matchs:
      void: ""
      0: '&b0'
      1-2: '&a%naruland_spawn_cooldown_time%'
      3-5: '&e%naruland_spawn_cooldown_time%'
      '>=6': '&c%naruland_spawn_cooldown_time%'
      else: '&4%naruland_spawn_cooldown_time%'
  • input: This is the variable to be evaluated to check the conditions. You can use any PlaceholderAPI variable or an external one.

  • matchs: The conditions to be checked are defined here.

    • void: Indicates that the variable is empty.

    • 1: If the input value is 1, it will return &b1.

    • 0-2: If the value is between 0 and 2, it will return &a%naruland_spawn_cooldown_time%.

    • 3-5: If the value is between 3 and 5, it will return &e%naruland_spawn_cooldown_time%.

    • >=6: If the value is greater than or equal to 6, it will return &c%naruland_spawn_cooldown_time%.

    • else: If none of the above conditions are met, it will return &4%naruland_spawn_cooldown_time%.

Comparisons

You can compare a value directly or use expressions like -, !=, >, <, >=, <=, ==.

Last updated

Was this helpful?