Make one plugin run events before all others?

Discussion in 'Plugin Development' started by NerdsWBNerds, Jun 4, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    NerdsWBNerds

    I have a plugin that I want to call before all others because it mainly manages if they are cancelled or not, how can I make sure it handles all events before other plugins?
     
  2. Offline

    RAFA_GATO_FOFO

    NerdsWBNerds
    Add a priority to the events on that plugin you want to be handled first.
     
  3. Offline

    TheUpdater

    create an event that calls the other events

    create em all custom and you deside when to call the events
     
  4. Offline

    Smerfa

    hyym, you should check how bukkit is calling events, I only know that "LOWEST" will be first, but if more than one plugin is using it... then...
    2 options:
    Random
    Name and/or dependence - So plugin starting by "a" char will be first, but if "a" plugin need "z" plugin as depend, then "z" will be before "a"
    Try check that on github :p
     
  5. Offline

    asofold

    You can't really make sure you get the event before all other plugins.

    You will be earlier than most with using EventPriority.LOWEST, but there is no equivalent to MONITOR for the other end, so there is no "earliest" priority level on which plugins are not to manipulate events, like with MONITOR.

    Unless there is a specific reason to use LOWEST, you should prefer to use LOW instead, to leave space for other plugins to be earlier, if they want it. It really depends on what you want to achieve. If it is all your own plugins i suggest putting the early one on LOW priority and the other to NORMAL (=no specification of eventPriority) and above.
     
Thread Status:
Not open for further replies.

Share This Page