-
Notifications
You must be signed in to change notification settings - Fork 215
PlaceholderAPI as the condition #365
Comments
This can be quite hard/resource expensive as PAPI does not have an event when a placeholder changes. |
Interesting! Maybe we should submit a feature request to PlaceholderAPI to add support for events? Otherwise we would have to do polling in a clever way. |
Could be possible however hard as some things do not fire an event when changing (bungee total for example). |
Yes it would be nice! Has anyone made the suggestion to the creator of papi ? |
I thought about it and I have an idea of how PAPI work. So it would be probably impossible for the creator of PAPI to do an event when a placeholder change. I have a simple idea to do that. We can play with two listeners, events PlayerJoinEvent and PlayerQuitEvent. |
I'm no PlaceholderAPI expert, so I'll trust you regarding the impossibility for it to support events. I don't think we even have to rely on the PlayerJoin and PlayerQuit events. As you suggested, we just have to call a function every X seconds/minutes which loops through all connected players. The AchieveDistanceRunnable and AchievePlayTimeRunnable classes do basically the same thing, so it could be a good starting point if you want to dig into this some more. 😉 |
Add PlaceholderAPI as the condition.
https://pastebin.com/raw/MNRbJcYj - correct look of examples with all spaces.
PlaceholderAPI_example:
%simpleclans_in_clan%:
true:
Message: Join any clan
Name: join_clan
DisplayName: Clan member
Reward:
Money: 5
PlaceholderAPI_example2:
%mypet_level%:
30:
Message: Your pet reached 30 level
Name: pet_master
DisplayName: Pet master
Reward:
Money: 5
PlaceholderAPI_example3:
%leaderheads_score_elytra_weekly_1%:
true:
Message: You are the best weekly glider!
Name: best_glider
DisplayName: Best glider
Reward:
Money: 5
The text was updated successfully, but these errors were encountered: