Solved EssentialsChat priorities

Discussion in 'Plugin Development' started by KingFaris11, Aug 25, 2014.

Thread Status:
Not open for further replies.
  1. Hi, I'm trying to make an event handler that uses mkremins Fanciful library and makes the chat JSONified I guess (so I can add a suffix)... Though, I need to keep the formatting and colour codes by EssentialsChat. I looked into the SRC of EssentialsChat and saw that they replace all the formats and stuff with priority at LOWEST. That's a problem for me, as I need to make my one even lower so that my code can run last. Is it possible to make the priority even lower than EssentialsChat's priority (LOWEST)?
     
  2. Offline

    Bammerbom

    KingFaris11 What I did for my plugin UltimateCore is checking is EssentialsChat is installed and cancelling my event if it is.
     
  3. Offline

    MasterDoctor

    Correct me if I'm wrong but I am 100% sure that LOWEST is the Lowest Priority!
     
  4. Ermm... that's not what I want. I need to make my code ALWAYS run after EssentialsChat. I need EssentialsChat to work with this plugin.

     
  5. Offline

    MasterDoctor

  6. It is. :/ I was wondering if you can make sure that one LOWEST priority is lower than another LOWEST priority. Or does Bukkit handle priorities randomly.
     
  7. Offline

    MasterDoctor

    I think it works by setting the first plugin to load with LOWEST priority as the LOWEST priority so in plugin.yml you can do loadbefore: EssentialChat or something like that
     
  8. Hmmm... I'll try that thanks.
     
  9. Offline

    Bammerbom

  10. Offline

    Necrodoom

    KingFaris11 you want your code to run last or first? Because the lower the priority, the earlier it runs.
     
    KingFaris11 likes this.
  11. What?! :O That doesn't make sense... the highest priority should mean it runs earliest... Ohhh.... that's actually what I want, I want it to run last. xD Fuk, I've been using the Bukkit API for 3 years+ and I always thought EventPriority.HIGHEST meant highest priority (running first).

    Edit: Yeap you're right: http://jd.bukkit.org/dev/apidocs/org/bukkit/event/EventPriority.html

    That's great then, I'll set the priority to HIGHEST. Thanks Necrodoom!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 10, 2016
  12. Offline

    AoH_Ruthless

    KingFaris11
    Be very careful with the way you handle priorities. If you want your plugin to make sure that you always get the final say with your event, then use highest. But there are cases where you want certain plugins to be able to override your event (sorry, can't think of any example pertaining to chat). Therefore, it could be better for you to use HIGH, or even NORMAL (default). Up to you to think about. On the other hand, make sure you never use MONITOR unless your plugin is a logging plugin or similar purpose.
     
    KingFaris11 likes this.
  13. Offline

    Onlineids

    AoH_Ruthless Thanks for stating this, nothing more annoying than a plugin using MONITOR it gives you 0 room to work with it.
     
    AoH_Ruthless likes this.
Thread Status:
Not open for further replies.

Share This Page