-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
The custom placeholders are configured in a simple Java property file in this location:
/plugins/CustomPlaceholders/customPlaceholders.properties
Apart from comments (lines beginning with '#'), each line contains one key and value, e.g.
rankHeroTab=<&5HERO>
rankHeroChat=[&5HERO]
With this example, the placeholder %custompapi_rankHeroTab% could then be used in a plugin like "TAB" to display the player's rank in the tab scoreboard, while the placeholder %custompapi_rankHeroChat% could be used with a chat plugin for the chat name prefix.
Sometimes you also want to avoid redundant text labels within this configuration file, like the redundant text "HERO" in the example above, including the color code prefix "&5". For that, you can basically define an "internal" constant, i.e. a property whose value is used by other placeholder properties. To reference a property from another one, the string must be the name of the referenced property, prefixed by ${ and followed by }. Example:
rankHero=&5HERO
rankHeroTab=<${rankHero}>
rankHeroChat=[${rankHero}]
It is also possible to use multiple such internal references within one property value, e.g.:
rankOne=HERO
rankTwo=ELITE
rankThree=MASTER
allRanks=Ranks: ${rankOne}, ${rankTwo}, ${rankThree}
The property aka placeholder values in this configuration file can also contain other PAPI placeholders themselves. Example:
serverLabel=Name: %server_name%, Version: %server_version%
And then use the placeholder %custompapi_serverLabel% anyhwere to display this label.