Placeholder API Support - ZeroG-Network/NeoEssentials GitHub Wiki
NeoEssentials provides comprehensive integration with Placeholder API, allowing you to use a wide range of dynamic placeholders from other mods in your NeoEssentials messages, templates, and configurations.
Placeholder API is a platform for mods to provide placeholders that can be used in various contexts. NeoEssentials both consumes placeholders from other mods and provides its own placeholders for use by other mods.
To use Placeholder API placeholders in NeoEssentials:
- Install Placeholder API for NeoForge on your server
- Install mods that provide placeholders via Placeholder API
- NeoEssentials will automatically detect and integrate with Placeholder API
You can use Placeholder API placeholders in NeoEssentials by enclosing them in curly braces with the papi:
prefix:
{papi:placeholder_name}
For example:
{papi:server_tps}
{papi:player_name}
{papi:essentials_nickname}
You can use Placeholder API placeholders in any NeoEssentials template:
{
"templates": {
"welcome": {
"lines": [
"&6Welcome, &e{papi:player_name}&6!",
"&7Your balance is &a{papi:economy_balance}"
]
}
}
}
Use Placeholder API placeholders in any NeoEssentials configuration:
[messages]
welcome = "&6Welcome to the server, &e{papi:player_displayname}&6!"
balance = "&aYour balance is &e{papi:economy_balance}"
You can use Placeholder API placeholders in command messages:
/broadcast "&aServer uptime: &e{papi:server_uptime}"
NeoEssentials registers its own placeholders with Placeholder API, making them available to other mods that support Placeholder API.
These placeholders are exposed to other mods through Placeholder API:
Placeholder | Description | Example |
---|---|---|
%neoessentials_balance% |
Player's balance | 1500 |
%neoessentials_balance_formatted% |
Formatted balance | $1,500.00 |
%neoessentials_homes_count% |
Number of player's homes | 5 |
%neoessentials_homes_max% |
Max homes allowed | 10 |
%neoessentials_warps_count% |
Number of available warps | 15 |
%neoessentials_kits_available% |
Number of available kits | 3 |
%neoessentials_currency_name% |
Currency name | Coins |
%neoessentials_currency_symbol% |
Currency symbol | $ |
%neoessentials_playtime% |
Player's total playtime | 10h 30m |
%neoessentials_playtime_seconds% |
Playtime in seconds | 37800 |
%neoessentials_first_join% |
First join date | 2025-06-01 |
%neoessentials_last_join% |
Last join date | 2025-06-25 |
You can nest placeholders within other placeholders:
{if:papi:economy_balance>1000}You're rich!{else}Keep saving!{/if}
When multiple placeholder systems are used, they are processed in this order:
- NeoEssentials internal variables
- NeoEssentials global placeholders
- Placeholder API placeholders
- Conditional processing
Apply formatting to Placeholder API values:
{papi:economy_balance:format:%.2f} → 1500.00
Here are some popular Placeholder API expansions and their placeholders that work well with NeoEssentials:
%player_name% - Player's name
%player_displayname% - Player's display name
%player_uuid% - Player's UUID
%player_health% - Player's health
%player_food_level% - Player's food level
%player_gamemode% - Player's game mode
%player_world% - Player's world
%player_x% - Player's X coordinate
%player_y% - Player's Y coordinate
%player_z% - Player's Z coordinate
%server_online% - Online players count
%server_max_players% - Maximum players
%server_ram_used% - Used RAM
%server_ram_total% - Total RAM
%server_tps% - Server TPS
%luckperms_prefix% - Player's prefix
%luckperms_suffix% - Player's suffix
%luckperms_primary_group% - Player's primary group
%luckperms_primary_group_prefix% - Primary group's prefix
%luckperms_meta_<key>% - Meta value
%luckperms_has_permission_<permission>% - Permission check
%luckperms_in_group_<group>% - Group membership check
%economy_balance% - Player's balance
%economy_formatted% - Formatted balance
%economy_currency_name% - Currency name
%economy_currency_symbol% - Currency symbol
%economy_top_balance_<position>% - Top balance at position
%economy_top_player_<position>% - Player name at position
You can create custom placeholders that combine multiple placeholders:
[placeholders.custom]
player_info = "&7Name: &f{player} &7Balance: &f{balance} &7Homes: &f{homes_count}/{homes_max}"
server_stats = "&7Online: &f{online_players}/{max_players} &7TPS: &f{tps}"
Once defined, you can use them anywhere:
{player_info}
{server_stats}
- Use placeholders efficiently to avoid unnecessary processing
- Cache complex placeholder results when possible
- Consider performance impact when using many placeholders in frequently updated text
- Enable placeholder caching in
config/neoessentials/config.toml
:
[performance]
cachePlaceholders = true
placeholderCacheTime = 30 # Seconds
- Placeholder Not Working: Verify the placeholder name and format
- Missing Expansion: Ensure the required expansion is installed
-
Incorrect Prefix: Check if you're using
{papi:placeholder}
format correctly -
Cache Issues: Try reloading placeholders with
/neoessentials:reload placeholders
Enable placeholder debugging:
/neoessentials:debug placeholders on
This will log placeholder processing to the console.
If you install new placeholder expansions or update configurations:
/neoessentials:reload placeholders
{
"templates": {
"welcome": {
"lines": [
"&6&l=== {papi:server_name} ===",
"&eWelcome, &b{player}&e!",
"",
"&7» &eCurrent Balance: &a{papi:economy_balance_formatted}",
"&7» &eRank: &a{papi:luckperms_primary_group}",
"&7» &eOnline Players: &a{papi:server_online}&7/&a{papi:server_max_players}",
"",
"&7» &eServer TPS: &a{papi:server_tps}",
"&7» &eServer Uptime: &a{papi:server_uptime}",
"",
"&6Enjoy your stay!"
]
}
}
}
{
"templates": {
"tablist": {
"header": {
"lines": [
"&6&l=== {papi:server_name} ===",
"&eWelcome, &b{player}&e!",
"&7Today is &f{date:dd/MM/yyyy}&7, &f{time:HH:mm}&7 server time",
""
]
},
"footer": {
"lines": [
"&7» &ePlayers: &a{papi:server_online}&7/&a{papi:server_max_players}",
"&7» &eTPS: &a{papi:server_tps} &7Uptime: &a{papi:server_uptime}",
"&7» &eBalance: &a{papi:economy_balance_formatted} &7Rank: &a{papi:luckperms_primary_group}",
"",
"&6&nwww.yourserver.com"
]
}
}
}
}
{
"templates": {
"status_board": {
"lines": [
"&6&l=== Player Stats ===",
"",
"&7» &eBalance: &a{papi:economy_balance_formatted}",
"&7» &eRank: &a{papi:luckperms_primary_group}",
"&7» &eHomes: &a{papi:neoessentials_homes_count}/{papi:neoessentials_homes_max}",
"&7» &ePlaytime: &a{papi:neoessentials_playtime}",
"",
"&6&l=== Server Stats ===",
"",
"&7» &ePlayers: &a{papi:server_online}&7/&a{papi:server_max_players}",
"&7» &eTPS: &a{papi:server_tps}",
"&7» &eMemory: &a{papi:server_ram_used}&7/&a{papi:server_ram_total} MB",
"&7» &eUptime: &a{papi:server_uptime}"
]
}
}
}
- Placeholder API Documentation
- NeoEssentials Placeholders
- Custom Templates
- NeoEssentials Discord for placeholder support