LuckPerms

LuckPerms

41.4k Downloads

Event for player/group meta changes

mikroskeem opened this issue ยท 5 comments

commented

I'd find such events extremely good for my scoreboard-based nametag prefix plugin. Polling isn't that good option for it in my opinion

Imagine this scenario:

  • /lp user mikroskeem meta addprefix 0 "&c&lOP" or ... meta set shortranks_prefix "&c&lOP&4 "
  • Event gets fired and plugin listens for given event
  • Scoreboard plugin updates scoreboard prefix(es)

// enhancement

commented

Yeah, I'm trying to plan out a restructure of the event API to make that clearer.

The current system was a bit rushed, and isn't very expandable/flexible.

commented

Question is though, is it finally time for a breaking API change (removing and replacing the current event package) or should I try to keep the old one?

commented

I think you can go for breaking API change, I don't mind

commented

Actually I can fetch meta changes using permission node set/unset events, since metadata is stored as permissions.

Now question is that is it worth to add separate event for meta changes

commented

Should be resolved by 6798fb2

I'll update the documentation soon, for now, here's the class you need to register your listeners.
https://github.com/lucko/LuckPerms/blob/master/api/src/main/java/me/lucko/luckperms/api/event/EventBus.java

You still need to listen for Permission Node Set/Unset events, but it should be much more reliable now.

For your scoreboard, you may also find UserDataRecalculateEvent to be useful. :)