How do I make my plugin load last of all?

Discussion in 'Plugin Development' started by EdenCampo, Oct 26, 2011.

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



  2. Offline

    Father Of Time

    Give it a wedgy and tell all the other plug-ins it has kooties... If I remember elementary school correctly that works pretty well... All seriousness though I don't know, some reason this just popped in my head and I found it funny. :D
  3. Offline



    Someone can REALLY help?
  4. Offline

    Father Of Time

    Well you're a kill joy... *runs off*
  5. Offline


    This sub-forum is for people who need help and want people who actually answer.
    Aengo likes this.
  6. Offline


    Eh.. I think you would have to use the Bukkit scheduler to delay the event
  7. Offline


    You shouldn't need to have your plugin load last of all to accomplish that. What you need is a listener that listens to when a world is loaded because with MultiVerse you can create worlds while the server is running. A good thing to do is look at a good solid plugin that already does that, like my plugin WeatherRestrictions.
    If you look on the onEnable() function in src/tux2/weatherrestrictions/ starting at line 67 you will see the proper way of adding the listener. The listener file itself is called Hopefully this helps you out.
  8. Offline


    If you need to have your plugin load after a certain plugin for dependency issues add:
    depend: [PluginThatLoadsFirst]
    To your plugin.yml
  9. Offline


    Okay, first off, you should rethink your design. There is a world load event you can listen to.

    BUT, if you want to keep your (poor) design, you can use a trick to make it load last. Add

    softdepend: zzzzzzz

    To your plugin.yml. Softdepends make your plugin load after other plugins, but only if they exist. This means the first time Bukkit tries to load your plugin, it will fail since zzzzzzz is clearly not a real plugin. The second time Bukkit tries to load your plugin is after the first pass, where 90% of plugins have loaded. Don't take my word for it, try it.
    Tux2 likes this.
Thread Status:
Not open for further replies.

Share This Page