Custom Placeholder
Custom Placeholders allow you to create your own placeholders and use them in all plugins that are compatible with PlaceholderAPI. For example, you can have one universal prefix for all messages, regardless of the plugin, and be able to change this prefix easily. Placeholder currently has 4 different types, each with its own features.
You can now use the placeholder %itsmyconfig_yourPlaceholder%
to display it in the game.
Argument
We have added the ability to add arguments to custom placeholders.
config.yml
custom-placeholder:
yourPlaceholder:
value: "This is your custom placeholder {0} !"
You can use the placeholder %itsmyconfig_yourPlaceholder_Enjoy%
to display your argument directly in the placeholder.
String Type
String placeholder is the default type, it allows you to create a simple placeholder with a string value. You don't need to specify the type, placeholder will automatically detect it.
config.yml
custom-placeholder:
your-placeholder-id:
value: "This is your custom placeholder"
type: "string" # Optional
How to use the placeholder
PlaceholderAPI
- Name
%itsmyconfig_<placeholder>%
- Description
Return the placeholder value
- Name
%itsmyconfig_<placeholder>_<arg-1>::<arg-2>%
- Description
Return the placeholder value with arguments
Placeholder Tag
- Name
<placeholder:_placeholder_>
- Description
Return the placeholder value
- Name
<placeholder:_placeholder_:_arg-1_:_arg-2_>
- Description
Return the placeholder value with arguments
Color Type
Color placeholder allows you to create a placeholder with a color value. You can use the color name or the hex color code. It's automatically create different placeholders for each format.
config.yml
custom-placeholder:
your-placeholder-id:
value: "red"
# Supported value: black, dark_blue, dark_green, dark_aqua, dark_red, dark_purple, gold, gray, dark_gray, blue, green, aqua, red, light_purple, yellow, or white.
# You can also use hex color code: #FF0000
type: "color"
bold: true # Optional
underlined: false # Optional
italic: false # Optional
strikethrough: false # Optional
obfuscated: false # Optional
How to use the placeholder
PlaceholderAPI
- Name
%itsmyconfig_<placeholder>%
- Description
Return the value
- Name
%itsmyconfig_<placeholder>_legacy%
- Description
Return the value in legacy format:
&c
for color and&#FF0000
for hex
- Name
%itsmyconfig_<placeholder>_console%
- Description
Return the value in console format:
§c
for color and§x§F§F§0§0§0§0
for hex
- Name
%itsmyconfig_<placeholder>_mini%
- Description
Return the value in miniMessage format:
<red>
for color and<#FF0000>
for hex
- Name
%itsmyconfig_<placeholder>_mini_<text>%
- Description
Return the value in miniMessage format but close the tag too:
<red>text</red>
for color and<#FF0000>text<#FF0000>
for hex
Placeholder Tag
- Name
<placeholder:_placeholder_>
- Description
Directly apply the style and color to the follow text, you can close the tag with
</placeholder>
. It's directly return the miniMessage format.
Animation Type
Animation placeholder allows you to create a placeholder with a list of values that will be displayed one after the other at a specified interval.
config.yml
custom-placeholder:
your-placeholder-id:
values: # Attention, values not value
- "<green>Animation !"
- "<yellow>Animation !"
- "<gold>Animation !"
- "<red>Animation !"
- "<pink>Animation !"
type: "animation"
interval: 20
How to use the placeholder
PlaceholderAPI
- Name
%itsmyconfig_<placeholder>%
- Description
Return the value
- Name
%itsmyconfig_<placeholder>_<arg-1>::<arg-2>%
- Description
Return the value with arguments
Placeholder Tag
- Name
<placeholder:_placeholder_>
- Description
Return the value
- Name
<placeholder:_placeholder_:_arg-1_:_arg-2_>
- Description
Return the value with arguments
Random Type
Random placeholder allows you to create a placeholder with a list of values that will be randomly displayed.
config.yml
custom-placeholder:
your-placeholder-id:
values: # Attention, values not value
- "Rock"
- "Paper"
- "Scissors"
type: "random"
How to use the placeholder
PlaceholderAPI
- Name
%itsmyconfig_<placeholder>%
- Description
Return the value
- Name
%itsmyconfig_<placeholder>_<arg-1>::<arg-2>%
- Description
Return the value with arguments
Placeholder Tag
- Name
<placeholder:_placeholder_>
- Description
Return the value
- Name
<placeholder:_placeholder_:_arg-1_:_arg-2_>
- Description
Return the value with arguments
Colored Text Type
Colored Text placeholder allows you to create a placeholder with a text that contains color and style and get output in different formats.
config.yml
custom-placeholder:
your-placeholder-id:
value: "<#d4acfb>Server Name</#d4acfb>"
type: colored_text
How to use the placeholder
PlaceholderAPI
- Name
%itsmyconfig_<placeholder>%
- Description
Return the value in miniMessage format:
<red>
for color and<#FF0000>
for hex
- Name
%itsmyconfig_<placeholder>_legacy%
- Description
Return the value in legacy format:
&c
for color and&#FF0000
for hex
- Name
%itsmyconfig_<placeholder>_console%
- Description
Return the value in console format:
§c
for color and§x§F§F§0§0§0§0
for hex
- Name
%itsmyconfig_<placeholder>_mini%
- Description
Return the value in miniMessage format:
<red>
for color and<#FF0000>
for hex
Placeholder Tag
- Name
<placeholder:_placeholder_>
- Description
Return the value in miniMessage format:
<red>
for color and<#FF0000>
for hex
Math Type
Math placeholder allows you to create a placeholder with a math expression that will be calculated and displayed.
config.yml
custom-placeholder:
your-placeholder-id:
value: "1 + 1"
type: "math"
rounding: HALF_UP # Supported value: HALF_UP, HALF_DOWN, HALF_EVEN, UP, DOWN, CEILING, FLOOR. Optional
precision: 1 # Number of decimal places. Optional
How to use the placeholder
PlaceholderAPI
- Name
%itsmyconfig_<placeholder>%
- Description
Return the value
- Name
%itsmyconfig_<placeholder>_<arg-1>::<arg-2>%
- Description
Return the value with arguments
Placeholder Tag
- Name
<placeholder:_placeholder_>
- Description
Return the value
- Name
<placeholder:_placeholder_:_arg-1_:_arg-2_>
- Description
Return the value with arguments
Progress Bar Type
Progress Bar placeholder allows you to create a placeholder with a progress bar that will be displayed.
config.yml
custom-placeholder:
your-placeholder-id:
value: ⦁●⚫●⚫●⚫●⚫●⚫●⚫●⚫●⚫●⚫●⚫●⦁
type: progress_bar
completed-color: '&a'
progress-color: '&e'
remaining-color: '&7'
How to use the placeholder
PlaceholderAPI
- Name
%itsmyconfig_<placeholder>_<value>_<max-value>%
- Description
Return the progress bar
Placeholder Tag
- Name
<placeholder:_placeholder_:_value_:_max-value_>
- Description
Return the progress bar
Requirements
Conditional placeholder is a system that help you to create more complex placeholder for create requirement and more.
When the placeholder %itsmyconfig_yourPlaceholder%
is parsed, the placeholder %player_name%
will be check if is the same placeholder will be return Hello Skyssy
Comparators
type: (==, >=, <=, !=, >, <)
input: "NUMBER"
output: "NUMBER"
Compares input:
with output:
.
Comparator | Description |
---|---|
== | input: equals to output: |
>= | input: greater than or equals to output: |
<= | input: less than or equals to output: |
!= | input: not equals to output: |
> | input: greater than output: |
< | input: less than output: |
String
type: (string equals/string contains) [ignorecase] [ignorecolor]
input: "TEXT"
output: "TEXT"
Checks if input:
matches output:
To invert the requirement (Check if the input doesn't match the output) you can simply add the exclamation mark before the type name (like this type: "!string equals ignorecase"
).
Regex matches
type: regex matches
input: "TEXT"
regex: "EXPRESSION"
Checks if input:
contains the regular expression in regex:
.
Visit this site to create regular expressions easily.
To invert the requirement (Check if the input doesn't contain the regular expression) you can simply add the exclamation mark before the type name (like this type: "!regex matches"
).!