PlaceholderAPI - A hub for your placeholders

Sponge is Java 8. Installing Java — Sponge 7.2.0 documentation

Ah right I forgot.

1 Like

The server can’t even start if it wasn’t java 8 lol, so yes I’m using java 8.

What placeholder did you test with? Did you try %statistic_deaths%?

Yes, I tested with that placeholder and it worked perfectly fine for me, however I tested it in 1.12 with version 4.1. I still would like to test on version 1.10.2 to confirm the issue, but I haven’t had time to do so yet.

I’ve updated to sponge 2620 (recommended) and it shows this. I’m using %statistic_kills% and %statistic_deaths%
I have statistics enabled in the placeholder config

Try disabling and enabling the stats module using commands

Tried that. Also tried manually editing the config and reloading. The parse command won’t work either and gives out the same error.
Seems like it’s only the stats module giving these errors. Any other module works fine. I feel like I’m missing something here.

So it looks like the statistics key was not supported in that version of Sponge. I will look into why that is but I doubt I can do much about it.

Just to make sure it’s not some error with that particular placeholder, can you also test %player_time_played%? That placeholder also depends on statistics and whether that works will determine how I can rectify the issue.

Also, I should note that I have yet to test the plugin in a 5.1 environment, so far I have only used 6.0 and 7.0 for testing and they both work. It is likely a fault with the internals of Sponge 5.1 (SpongeForge or SpongeCommon, namely) that prevents this from working, but if the time placeholder works then it is something I need to fix.

Ok so I checked on the SpongeCommon source code, and there was no statistic implementation on the Sponge side until SpongeAPI 6.0. Unfortunately, this means that the %statistic_...% placeholders will not work due to the lack of implementation. See here for the version 5 list of supported keys (press ctrl+f and search “statistic”) and here for version 6 (search again, this time you will find 6 results and not 0). There is unfortunately no way I can fix this issue as I cannot determine the statistics without breaking platform, api and version support that the plugin already has.

%player_time_played% doesn’t work either.

And ah that’s unfortunate. I wonder if they plan to backport the feature and add it to API5

A new version has been released for PlaceholderAPI, it is available for download here.


What’s new in 4.2:

This update has been a long time coming and I am sorry it took so long. I have been really busy with university and as such neglected the plugin.

This update is VERY big. If you find bugs or issues, please report them on the GitHub page so they can be fixed as soon as possible. I expect most plugins using this plugin should still work properly but if not please report the issues on GitHub.

  • Transitioned from [CommandSource, User and MessageReceiver] minimum level to [Subject, DataHolder, MessageReceiver and Locatable] as minimum level information holders. Everything should still function the same but now there is support for slightly lower level data.
  • Fixed issues with source observer value checks.
  • API BREAKING (though not too important I hope): Changed builder() method in PlaceholderService to builder(Class, Class, Class). This makes internals a lot easier as well as builder chaining.
  • Economy additions
    • Added baltop which calculates the top balances for a currency. Examples: baltop, baltop_5, baltop_tokens, baltop_7_tokens.
  • Sound placeholder now supports [sound]_all or all_[sound], to play to all players.
  • Many economy fixes
    • Fixed issue where non-default currencies were not properly being replaced.
    • Fixed issues with `%economy_baltop% placeholder, should now function as expected.
  • Null value support
    • In placeholder method calls, it is safe to assume all parameters are present and not null unless you specify the @Nullable annotation.
  • Automatic string standardization now allowed in the @Token annotation. Specify fix=true on a String parameter and it will be made all lower case.
  • Internal placeholder generation fixes. Primitives now work properly.
  • Added uptime placeholder to server. This calculates uptimes over time and saves to file. I will be adding an option to disable this soon.
  • Fixed configuration save/load for placeholders.
    • BREAKING CHANGE: If you use @Setting to store data for placeholders, you MUST include the new @Attach annotation to attach it to a placeholder. The annotation takes in a String value which is the id of the placeholder to attach to.
  • Objects in parameters of methods will now be deserialized. You can, for instance, have an Integer token instead of a String and it will automatically parse for you.
  • Lots of cleanup
  • Better debugging for placeholders.
    • If a placeholder fails to parse, it will show up what went wrong in red. If the id is wrong, the whole placeholder will be red. If there are issues with the tokens, the tokens will be in red. If this is displayed in chat, you can hover over the placeholder to see what went wrong and if there are any suggestions for a fix.
  • Changed default config file. If you delete the current config file you will get the new, proper file.
  • Fixed enable/disable a bit, should have better restart-retention.
  • Separated API from Implementation. For most purposes, there should be no issues, unless you try to use implementation-dependent functions.

The next update will include the fixes for uptime as well as a new @Requires placeholder which establishes the requirements for a placeholder. You can specify what minimum (or maximum) Sponge version, or any plugin dependencies, and more externalized messages.

*I have yet to update the wiki page. Please be patient as I do not have much time.

Check out the plugin wiki!

View the plugin on GitHub!

See the plugin’s statistics!

A new version has been released for PlaceholderAPI, it is available for download here.


What’s new in version 4.3:

This is a relatively small update, including unfinished features from 4.2 as well as bug fixes and changes made to make things more efficient.

  • Added @Requires annotation. This annotation can be attached to a placeholder method to specify version range required of SpongeAPI or a plugin. This is still quite experimental and I recommend AGAINST using it until a future update rolls out as I am still unsure of some things about this. Due to the nature of the annotation, there is no existing documentation for it yet. Sorry.
  • Fixed config resetting the value of enabled on a placeholder when reloading. Placeholders now properly preserve enabled states through restarts.
  • Server uptime config saving should no longer affect other config values as well.
  • Economy placeholder will no longer disable itself if it does not detect an economy plugin. This should resolve load order issues as well as other enable/disable and config issues. The placeholder will now simply spit out an error if there is no economy plugin installed. This will also make diagnosing issues a bit easier.
  • Fixed a NPE in the loading functions if the config has issues loading. This seems to be a spot issue with Configurate that should not really happen but I will continue looking into it if it persists.

This is a pretty small update but should fix a lot of issues that have recently surfaced. Sorry for the inconvenience.

*I have yet to update the wiki page. Please be patient as I do not have much time due to real life involvement.

Check out the plugin wiki!

View the plugin on GitHub!

See the plugin’s statistics!

A new version has been released for PlaceholderAPI, it is available for download here.


What’s new in version 4.4:

  • Fixed issue with configuration files not properly loading. This is sort of a workaround and I fully expect more issues to arise from this (particularly, some people having config resets even if they properly handle config files). If anything arises I will try my best to patch it out but I cannot properly figure out why this is breaking.
  • Slightly improved the Requires annotation internals.

This is a minor patch and should work with everything normally. The next big update will be version 5.0, but before that I will release version 4.5 which deprecates everything to be removed (I plan on refactoring the whole internal system of how dynamic placeholders are handled, as well as adding support for object-attached placeholders and injecting into foreign plugins, though injection probably won’t work in Java 9).

I still have yet to document my changes; I am heading into my exams right now so don’t expect anything new to happen for at least a month from me. If anyone is willing to help document that would be much appreciated, though I am not sure how difficult it will be.

Check out the plugin wiki!

View the plugin on GitHub!

See the plugin’s statistics!

Screenshot - de557cbdfd06da27a715cc4adff4bcdb - Gyazo Not sure what caused this. Any info on what it might be would be appreciated <3

Trying to run parse from console to get information about the user, but whenever I do it doesn’t return the information, instead the placeholder names I requested in curly brackets.

So /papi p Tridaak %player_exp% %player_name% from console gives: {player_exp} {player_name}
While when done in game I get: 0 Tridaak

Using PlaceholderAPI-4.4 and SpongeForge-1.12.2-2705-7.1.0-BETA-3148

Is the targeted player online when you execute it from console?

Edit: If that’s the case, then it is because of Players being online objects, Users are the offline objects of players.

I opened a PR which adds the user placeholder which can do something, but not everything(you can get the name but I don’t think any data like experience level).
Since the PR never really got attention, I released a new version myself: Release v4.5.1 · randombyte-developer/PlaceholderAPI · GitHub

There are these placeholders:

  • user
  • user_name
  • user_displayname
  • user_uuid

The player is online when I try the command, tried it on multiple users with different placeholders, always returns {placeholder} (as if the placeholder didn’t exist), but when done from in-game, executes it successfully.

Just try the build I linked above, there are several other things fixed in there.

I’m using that one now and still getting the same problem.
I’m pretty sure I’m using the right command, run the exact same command from console and from ingame.