How to check if plugin is enabled?

Discussion in 'Plugin Development' started by The Wiseman, Nov 23, 2011.

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

    The Wiseman

    I am trying to figure out how I can determine if a plugin is enabled or not. In this case, I am checking if mcMMO is enabled or not. I am getting this error:



    My variable is this (Line 15)
    Code:
    Plugin isMcMMOEnabled = getServer().getPluginManager().getPlugin("mcMMO");
    I also tried this with isPluginEnabled("mcMMO"); But that did not work either.

    Any ideas?
     
  2. Offline

    Jaker232

    In plugin.yml, put

    Code:
    depend: [mcMMO]
    
    See if that works.
     
  3. As @Jaker232 said, if you put depend: [mcMMO] in your plugin.yml, Bukkit will make sure mcMMO is loaded before your plugin.
     
  4. Offline

    The Wiseman

    I highly doubt that will work. The plugin itself is not dependent on mcMMO at all. It is an option though.
     
  5. Offline

    Jaker232

    For more help on depend: [mcMMO] click this link or load the plugin.yml reference.
     
  6. Offline

    DrAgonmoray

    If it's an option, then do "softdepend: [mcMMO]"
    That will make it load mcMMO if it's there.

    Also:
    Code:
    getServer().getPluginManager().isPluginEnabled("mcMMO");
     
  7. Oh, I completely forgot about softdepend. That'll help me in the future, thanks!
     
Thread Status:
Not open for further replies.

Share This Page