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

Error getDataFolder () in config

Comments in 'Plugin Development' started by Palente, Nov 13, 2016.

  1. Palente
    Offline

    Palente New Member

    Joined:
    Jan 16, 2016
    Posts:
    9
    Minecraft User:
    Palente
    Hey, I have a problem When I run My code(bottom this message) Idea: I want to create a lang.yml for Player can change The language of Plugin.
    PHP:
    class loader extends command {
    public function 
    execute(CommandSender $args$command, array $args){
    $cfg= new Config($this->getDataFolder() . "lang.yml"Config::YAML);
    $cfg->set("lang""en");
    $cfg->save();
    #Some codes not important
    Console return error getDataFolder ()
    Sorry for my bad english
  2. PocketKiller
    Offline

    PocketKiller Notable Member

    Joined:
    Jul 20, 2015
    Posts:
    741
    STOP
    GO TO THE NEW FORUMS
  3. matthww
    Offline

    matthww Active Member

    Joined:
    May 13, 2014
    Posts:
    91
    Minecraft User:
    Matthww
  4. Thunder33345
    Offline

    Thunder33345 Notable Member

    Joined:
    Apr 3, 2014
    Posts:
    755
    Minecraft User:
    Thunder33345
    you need to check if the dir exist if not mkdir it
    often times it should be placed in the onEnable part

    just dont come here eventually more people do that it would just be me helping everyone

Share This Page

Advertisement