Minecrell / ServerListPlus

A flexible Minecraft plugin to customize the appearance of your server in the server list
https://git.io/slp
GNU General Public License v3.0
241 stars 58 forks source link

Placeholders for online players #165

Open jonthesquirrel opened 7 years ago

jonthesquirrel commented 7 years ago

As discussed in #90 and #88 the plugin can't get placeholders of the player viewing the server list as they are not online. However, what I am proposing is to add PlaceholderAPI support to the player list. So right now I have this in my hover config:

%random_players,100|
%

and my goal is to show each online player's displayname instead of their username.

jonthesquirrel commented 7 years ago

I wrote a plugin that adds a placeholder to ServerListPlus that fits my use case for using PlaceholderAPI. It's up to you if you still want to add this feature, but I don't need it anymore. :)

Here's the format I settled on, if you're interested.

%placeholderapi_players,5`{vault_prefix}{player_name}`|
%

The string inside the backticks is formatted for each online player through PlaceholderAPI.

stephan-gh commented 7 years ago

Awesome, this is why the API exists. :) I'll keep this open for a bit until I decide if I'll include this in SLP 4.0.