PlaceholderAPI Scoreboard Objectives Placeholder icon

PlaceholderAPI Scoreboard Objectives Placeholder -----

Retrieve name & scores for scoreboard objectives using placeholders!




Fixes a server crash - potential infinite loop in getRank() due to case sensitivity.
Thanks to @Xenapte
----------, Mar 9, 2024

Fixes a server crash - potential infinite loop in getRank() due to case sensitivity.
Thanks to @Xenapte
----------, Mar 6, 2024

Minor update to fix a reported issue (console error) that happened in combination with certain other plugins that call Placeholder's onRequest() asynchronously.
----------, Dec 2, 2023

Added placeholders:
%objective_entries_{<objective>},<all/any/size>%
%objective_entries_{<objective>}_for_score_{<#>},<all/any/size>%
%objective_rank_{<objective>}%
%objective_rank_{<objective>}_{[entry]}%

Also made debugging easier with error messages show to player (instead of just spamming the console)
----------, Aug 3, 2023

* Fixed an off-by-1 error in entrypos and scorepos
* Compatible with Java16+ (previously required Java19+)
----------, Jan 28, 2023

Added support for inner-nested expansions (requested by @Yoshi_Galaxy)

You can take any expansion available on your server and have it as an input (inside the curly-braces) for expansions in ScoreboardObjectives.
Due to PlaceHolderAPI parsing, inner expansions do not use %%

Example (sorry I'm too lazy to think of a better one):
%objective_displayname_{test}% => "deaths"
%objective_displayname_{deaths}% => "Number of Deaths"
%objective_displayname_{objective_displayname_{test}}% => "Number of Deaths"
----------, Jan 25, 2023

The original author ( @LethalBunny) has handed maintenance responsibility of this expansion over to me ( @EvModder), and I have gone ahead and extensively reworked this expansion to provide a bit more flexibility and also performance improvements for servers that parse the "scorepos" placeholder with high frequency.

All old syntax should still work, with the notable exception of the %objective_scorep_{objective}_{entry}% placeholder, which no longer verifies if {entry} is a player name, and now just behaves as an alias for %objective_score_{objective}_{entry}% (this might get changed again in the future).

You may notice that a lot of the old placeholders have disappeared from the description page--they are still supported (and will continue to work into the future), but since the newer syntax is simpler and supports all the same features I felt it unnecessary to list out both the new and old versions of each.
----------, Dec 13, 2022

Added
Code (Text):
%objective_scoreof_{<obj-name>}_for_<placeholder>%
This will first parse <placeholder> as an Entry, then attempt to retrieve the score of <obj-name> for that Entry.

Example:

If:
Code (Text):
%objective_entryposhigh_{mostKills}_{1}% = LethalBunny
Then:
Code (Text):
%objective_scoreof_{deaths}_for_objective_entryposhigh_{mostKills}_{1}%
= the # of deaths for the Entry with the Most Kills aka deaths for LethalBunny

- you can thank @Craked_wolf for this feature ;)
----------, Jun 12, 2022

Adds the much anticipated placeholders for sorting scores by rank and getting either the score or entry at a certain position in the ranks. 4 new placeholders, 2 for getting scores sorted by Highest or Lowest, and 2 for getting entries sorted by Highest or Lowest:
%objective_scoreposhigh_{<obj-name>}_{<#>}%
%objective_scoreposlow_{<obj-name>}_{<#>}%
%objective_entryposhigh_{<obj-name>}_{<#>}%
%objective_entryposlow_{<obj-name>}_{<#>}%

Please Note: this version uses String.isEmpty() which was implemented in Java 11 so your server must have Java 11 or newer.
----------, Dec 27, 2021

- Added changes to support the new PAPI 2.11.0 API.
- Also now on native 1.16 though nothing changed there.
- Added new placeholders to support Scoreboard objectives and Player names that contain underscores. The old placeholders will continue to work fine.
- Cleaned up code and removed a lot of duplication.
----------, Aug 24, 2020

added placeholder:
%objective_displayname_<obj-name>%
----------, May 28, 2020

just used the new jars to support new version, nothing changed.
----------, Sep 12, 2018

Clip will be implementing API to use getName() method to identify expansions on ecloud and your installed directory. This is to support that future update.
----------, Jul 6, 2018

[otherPlayer] is now case insensitive since it's only checking for players not non-player entries.
----------, Jul 6, 2018

%objective_scorep_<obj-name>% = works just the same as %objective_score_<obj-name>%
%objective_scorep_<obj-name>_[otherPlayer]% = checks if the optional parameter [otherPlayer] is a player, if not, returns PNF
----------, Jul 1, 2018

Oops, made a mistake, don't download this version! Fix coming out.

The following is wrong, removes intended use for non-player objectives.
The optional <player> parameter when passed wasn't being checked it was an actual player that existed on your server therefore if you passed in garbage you'd always get 0 instead of the intended PNF. You will now get PNF if the optional parameter isn't actually a player on your server.
----------, Jul 1, 2018

This is a big one!

- Removed deprecated methods to support future versions =D
- Changed [otherPlayer] to [otherEntry] because Scoreboards can contain entries that aren't players
- Yes [otherEntry] will now also get scores of Entries not just Players
- [otherEntry] will also get score of Offline players!
- Optimized code and made the plugin smaller =D
----------, Apr 19, 2018

Fixed a bug where using the optional parameter for a player that had an underscore in their name return score for just the calling player instead.

Optional parameter now supports players with underscores in their name.
----------, Dec 21, 2017

Sorry for the quick redaction of version 2.0 but version 3.0 allows the original placeholder to work for both calling player and other player by just tacking on an optional parameter at the end.

This will allow you to pass on a second parameter to the placeholder and if that second parameter is empty, it'll default to calling player, otherwise if the 2nd parameter is an online player, it'll return their score instead.

Also made some code optimizations to save a few bytes :D
----------, Dec 16, 2017

Can return the following error strings:

{empty string} - Score does not exist
PNF - Player Not Found
PDNE - Placeholder Does Not Exist
----------, Dec 16, 2017

Now returned score doesn't have to be of the calling player, added a new variable for OTHER player:

%objective_playerscore_<player>_<obj-name>%

where <player> is the OTHER player who's info you desire, and
<obj-name> is the name of the object's score you want.
----------, Dec 16, 2017

Resource Information
Author:
----------
Total Downloads: 11,224
First Release: Oct 10, 2017
Last Update: Mar 9, 2024
Category: ---------------
All-Time Rating:
8 ratings
Find more info at api.extendedclip.com...
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings