MobHunting

MobHunting

114k Downloads

Feature request: PlaceholderAPI expansion

SlimeDog opened this issue ยท 36 comments

commented

Please consider making an Expansion for PlaceholderAPI, so MH variables can be used wherever placeholders are supported.

commented

yes, i will do that, but I need some suggestions for place holders and what they should show?

commented

If you write the Expansion, just include everything. That way, I can use any of them on signs, etc.

commented

I cant include everything ???? I need some examples.... to understand what you want to show

commented

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
commented

%vault_rank%
%vault_prefix%
%vault_rankprefix%
%vault_suffix%
%vault_ranksuffix%
%vault_prefix_color%

commented

I am LasagnaFTW fyi

commented

The Vault placeholder variables do not need to be included in the MobHunting expansion. Just download and install the Vault expansion.

commented
  1. How
  2. I am using them for the leaderboards so I can put player prefixes next to their name.
commented

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.

commented

I have actually added my first PlaceHolder %hm_total_kills%

But I dont understand how to make the expansion jar and publish it???

commented

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% ?

commented

I have looked for Youtube videos, but I did not find any ???

commented

I use Placeholders with ScoreboardStats (flaky) and SignBoard. You have to install:

Then in SignBoard, you use %variable% to display the value of a variable. Pretty straightforward.

commented

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.

commented

Thank I will test SignBoard on my TestServer, it looks actually interesting

commented

Now I have my first placeholder working... total_kills (its only beta, but I have understood how it works now)
2017-10-20_17 32 28

So from now on it will be easier :-)

commented

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.

commented

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}%

commented

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.

commented

dropped_money and dropped_rewards is left on ground :-) try it :-)

I made them for you

commented

I like them. Thanks.

commented

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. :-(

commented

I think (hope) @Fyrlex meant to implement the PlaceholdersAPI interface, so that MH placeholder consumers have access to the thousands of PAPI variables.

commented

allow placeholders like from vault into everything, papi placeholders and the placeholders from other plugins

commented

@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' ๐Ÿ˜›

commented

And please remember that the player placeholders only work for online player, like I described in the spigot forum

commented

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...

commented

Understood. It's always fun to try "everything everywhere". :)

commented

well can you add a placeholder that gets a vault rank's prefix?

commented

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.

commented

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?

commented

And I am not a genius on how placeholders need to be set up, but I do know what they do.

commented

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.

commented

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 )

commented

Alright ok, I understand now.

commented

I close this for now, feel free to ask for new placeholders.