Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to check if a plugin is enabled on your server

Comments in 'Plugin Development' started by EschieEsh, Apr 2, 2016.

  1. EschieEsh
    Offline

    EschieEsh Active Member

    Joined:
    Jun 28, 2014
    Posts:
    69
    Minecraft User:
    Escherion
    For example EconomyAPI.

    So what I want to do is ->

    Disable some commands in my plugin IF EconomyAPI is disabled as well.


    What should I do?
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    PHP:
    public function isPluginLoaded(Server $serverstring $pluginName){
        return (
    $plugin $server->getPluginManager()->getPlugin($pluginName)) !== null and $plugin->isEnabled();
    }
    AndrewBit and CraftYourBukkit like this.
  3. EschieEsh
    Offline

    EschieEsh Active Member

    Joined:
    Jun 28, 2014
    Posts:
    69
    Minecraft User:
    Escherion
    Wow that was quick. Thank you
  4. TheDeibo
    Offline

    TheDeibo Notable Member Plugin Developer

    Joined:
    Sep 8, 2014
    Posts:
    692
    Plugins:
    1
    Minecraft User:
    TheDeibo
    thats handy.... as i (and chosen few) are going to make a big plugin, and we can have that piece of code.

Share This Page

Advertisement