1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

getPlugin config?

Discussion in 'Development' started by eDroid, Nov 22, 2016.

  1. eDroid

    eDroid Witch

    Messages:
    59
    GitHub:
    edroiid
    Hello. Is it possible to get a different plugins config? If so how would i do so? I have tried:
    PHP:
    $this->getServer()->getDataFolder()
    but thats no help since it doesnt work.
     
  2. Primus

    Primus Zombie Pigman

    Messages:
    749
    Yes you can. There are two ways. Load the config yourself or get it from plugin object.

    About the code; I don't see how it could work. If the function exists then probably only returns a string, the path to server directory.
     
    eDroid likes this.
  3. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Every plugin has a getDataFolder() method.

    PHP:
    $folder $server->getPluginManager()->getPlugin($pluginName)->getDataFolder();
    $configFile $folder "config.yml";
    If the plugin uses the getConfig method, you can use it directly too.

    Note that editing the file doesn't mean the plugin will change its behaviour immediately.
     
    eDroid likes this.
  4. eDroid

    eDroid Witch

    Messages:
    59
    GitHub:
    edroiid
    Thanks. That will help. Im trying to copy a piece of data found with-in the config.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.