[SOLVED] When does onPluginEnable fire?

Discussion in 'Plugin Development' started by jtripled, Aug 22, 2011.

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

    jtripled

    Simple question:

    Does the "onPluginEnabled" event in the server listener fire before or after that plugin's onEnable block?

    ANSWER:

    In case anyone ever stumbles into the search box looking for the answer to this same question...

    The event "PluginEnableEvent" fires AFTER the onEnable() block of code in the plugin that is being enabled.
     
  2. Offline

    thehutch

    onPluginEnabled is used for your plugin to check if another plugin is used. So if you want to check if iConomy/Permissions is enabled then you would use this method.
     
  3. Offline

    jtripled

    I understand all of that, but I was curious as to whether another plugin that has registered the event PluginEnabledEvent would see that event fire before the plugin that is being enabled executes it's onEnable() block.
     
  4. Offline

    thehutch

    No basically after your plugin is enabled it checks every other plugin loaded and checks if it matchs the one your looking for
     
  5. Offline

    nisovin

    I get the feeling you don't understand the question.

    I don't know which goes first. I'd just create a simple plugin that writes to the console, once in onEnable and once when the event fires. Then you'll know.
     
  6. Offline

    jtripled

    Well that will find the answer. I was seeing if anyone knew before I had to resort to making my lazy self do that.

    Ah well, thanks, though.
     
Thread Status:
Not open for further replies.

Share This Page