Solved server plugins on enable

Discussion in 'Plugin Development' started by zakkinu2, Sep 24, 2013.

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

    zakkinu2

    Do plugins liad up before the server is open? Cause i want it so if there is no players on the server when it loads up it will clear a list from config
     
  2. Offline

    chasechocolate

    I don't exactly understand your question, but you can check if pm.getPlugin("SomePlugin") != null (where "pm" is the PluginManager), or listen for PluginEnableEvent.
     
  3. Offline

    zakkinu2

    chasechocolate Well what i really meant is, Do plugins load up before the server opens for people to join?
     
  4. Offline

    Janmm14

    zakkinu2 Yes. But if soemone uses /reload, onDisable() and onEnable() is called while people are on the server.
     
  5. Offline

    Shevchik

    Or if somebody decide to enable/disable plugin using plugin manager.
     
    Janmm14 likes this.
  6. Offline

    Gopaintman

    Yes plugins do load before server is open to players as far as I know. However I believe there is a Scheduler task that can run after a certain delay.
    Code:java
    1. Bukkit.getScheduler().runTaskLaterAsynchronously(this, task, delay)


    I would put that in your onEnable() method, and then as the task do your check.
     
Thread Status:
Not open for further replies.

Share This Page