PlaceholderAPI
Scorpion edited this page 4 years ago

As of 1.6.0-SNAPSHOT PlaceholderAPI is an option in ranks! PlaceholderAPI is available with AdvancedBCRanks

What this means every stat by every plugin can be used without direct support!

Do note, some statistics integrated by other plugins using placeholderapi may require an ecloud extension. For example:

XLTournaments has several placeholders for you to use(if you own the plugin)

%xlt_{tournamentId}_top1name%
%xlt_{tournamentId}_top2name%
%xlt_{tournamentId}_top3name%
%xlt_{tournamentId}_top1score%
%xlt_{tournamentId}_top2score%
%xlt_{tournamentId}_top3score%
%xlt_{tournamentId}_score%
%xlt_{tournamentId}_position%
%xlt_{tournamentId}_type%

To make placeholderapi use these placeholders and bcranks to read them, the following command must be used prior: /papi ecloud download XLTournaments

After that you can use it!

The following shows 2 setups you can use to make it work:

First is an integer(x>=y) i.e: x = 5 y = 10, results in 5>=10

Requirements:
    - 'placeholderapi;integer;%xlt_{tournamentId}_score%;40;Obtained %s Tournament Points;Gain %s Tournament Points. Current: %current%'

In the above example the player must have a minimum of 40 tournament points to meet the requirement.

When comparing numbers bcranks must know wether or not its a string, or integer, for this all integer methods require to start with 'integer'

To compare a string(name1 equals name2) the same formula must be used except integer should not be included. Example:

Requirements:
    - 'placeholderapi;%statistic_mine_block:grass_block%;40;You dug out %s Grass Blocks;Dig out %s Blocks. Current: %current%'

The above example requires the player to have exactly 40 grass blocks mined, no more, no less. Adviced is to only use the string for name sake, but otherwise use 'integer' to compare numbers.

Again, there are MANY requirements available, too many to list them all.

A full list of all currently ecloud supported(listed) plugins can be found here

Some plugin, may use placeholders but not use the ecloud version, or use mvmplaceholder which placeholderapi also supports. The good part about using placeholders in this manner is you can pretty much create your own list of how its displayed which other hooks currently do not.