Hey i am trying to return a config value when running an command. I konw The error is in the 2nd line from the bottom but i dont have any idea how to change that.On the end of the function is return true; so without trying to return the value it is working. Code: if(strtolower($command->getName()) === "sj"){ if($args[0] == "create"){ $config = (new Config($this->getDataFolder() . "arenas.yml", Config::YAML, array( "$args[1]" => ["world", "minp", "maxp"], )))->getAll(); $config["$args[1]"]["world"] = "test"; return $config["$args[1]"]["world"]; $p->sendMessage("$args[1]"); }
returning the value sets the output of the function to be the returned value. it does not display the value anywhere. Please learn at least the basics before requesting help here. Your issue isn't even API related.