Feature request: PlaceholderAPI expansion
SlimeDog opened this issue ยท 36 comments
Please consider making an Expansion for PlaceholderAPI, so MH variables can be used wherever placeholders are supported.
yes, i will do that, but I need some suggestions for place holders and what they should show?
If you write the Expansion, just include everything. That way, I can use any of them on signs, etc.
I cant include everything ???? I need some examples.... to understand what you want to show
I don't have a current use case. I guess I would start with:
- Total_Cash
- Total_Kills
- Total_Assists
- Bonus_Cash
- Bonus_Kills
- Bonus_Assists
%vault_rank%
%vault_prefix%
%vault_rankprefix%
%vault_suffix%
%vault_ranksuffix%
%vault_prefix_color%
The Vault placeholder variables do not need to be included in the MobHunting expansion. Just download and install the Vault expansion.
- How
- I am using them for the leaderboards so I can put player prefixes next to their name.
What you want is for MobHunting leaderboards to recognize PlaceholderAPI variables. That would be a separate, and useful, addition to MobHunting. You should open a new issue for that topic.
This thread is about creation of a MobHunting expansion for PlaceholderAPI. (Other plugins, for example Vault, already present expansions for PlaceholderAPI.) Once @Rocologo publishes a MobHunting expansion for PlaceholderAPI, all plugins that play well with PlaceholderAPI will have access to the MobHunting variables. as well as to the thousands of other recognized variables.
I have actually added my first PlaceHolder %hm_total_kills%
But I dont understand how to make the expansion jar and publish it???
I have actually added my first PlaceHolder %hm_total_kills% using the tutorial for developers, and it was not that hard.
But I need some help. I dont know how to use the placeholders. Could one of you tell a VERY how to make a very simple test. 1. using a placholder from another plugin, and then an example of what I should do to use my own placeholder %hm_total_kills% ?
I use Placeholders with ScoreboardStats (flaky) and SignBoard. You have to install:
- SignBoard
- PlaceholderAPI
- PlaceholderAPI expansion for the variables class you want to use
Then in SignBoard, you use %variable% to display the value of a variable. Pretty straightforward.
The variable I would find most useful is the number of bags of gold that the player hasn't picked up: # of rewards left in MH debug.
Please help me with the testing, use build 487 or newer
https://fractal.lindegaard.one:8181/job/MobHunting/
V5.1.6 Snapshot
- Added support for PlaceHolderAPI.
- Placedholders added: %mobhunting_rank% (Only updated when leaderboards is updated), %mobhunting_total_kills%
%mobhunting_total_cash%
%mobhunting_droped_money%
%mobhunting_dropped_rewards%
Im not sure if the last two is accurate. I only made them for some debugging at some point, but you might find bugs, and I dont thing dropped heads with a value counts or not yet.
You dont need to download any expansion. The placeholders is present if you have PlaceHolderAPI installed.
Nice. Hopefully, it is: %mobhunting_dropped_money%
I would still like the number of rewards left on the ground: %mobhunting_unrecovered_rewards% or %mobhunting_left_rewards% or mobhunting_{appropriate_variable_name_here}%
I have decided to make
%mobhunting_balance% to get the amount of bagofgold in the player inventory.
Also I will see if I can add support for placeholders in the Lang file.
dropped_money and dropped_rewards is left on ground :-) try it :-)
I made them for you
Its not possible to allow placeholders into "everything" This is unfortunately not how it works. But if you have specific requests, then I will see if it is possible to implement.
Notice that player-specific placeholders only works for player which is online. :-(
I think (hope) @Fyrlex meant to implement the PlaceholdersAPI interface, so that MH placeholder consumers have access to the thousands of PAPI variables.
allow placeholders like from vault into everything, papi placeholders and the placeholders from other plugins
@FurLex It really sounds like you understands how placeholders work... ๐ฎ
You to tell me where you want to use placeholders from other plugins. And please don't answer 'everywhere' ๐
And please remember that the player placeholders only work for online player, like I described in the spigot forum
Yes, I Think so too, but this is something I have to do everywhere I write to the player chat or write a text somewhere else. So the is not something I just do in 1 hour 'everywhere'
Ps. I have started today, but I have to do a lot of changes...
When a player kills a mob, the date, the playername, the kill and the mobname is stored in the database for statistics. I dont know exactly where the players prefix is stored, this is not a part of MobHunting. PlaceHolders or not. What I know is that you cant get the players prefix through placeholder %vault_prefix% if the player is not online. The player specific placeholders does only work for players who is online.
So it can't be like, when a player gets a kill, the database or whatever stores the amount of kills and names, and gets the players prefix?
And I am not a genius on how placeholders need to be set up, but I do know what they do.
But the second a player kills a mob it can get the name and prefix and store it. Players will probably be online a few seconds after a kill, that's the time for the holograms to get the name and prefix and show it, then when they go offline it just leaves it alone because it already got the players prefix.
yes, you are correct MobHunting could in theory store any player information when the player is online in MobHuntings own database, but this is NOT a solution I will make, just because PlaceHolders cant handle your wish. Im sorry. PlaceHolderAPI has more than 1000 placeholder, imagine the work I would have to do to support store all kind of placeholders... The solution is not changing MobHunting, the solution is to ask the developer of PlaceHolderAPI to support OfflinePlayers. (Which I did earlier today : https://www.spigotmc.org/threads/placeholderapi.61918/page-84#post-2723753 )