I have this: PHP: Badwords:- word1- word2- word3 lets say i want to remove word2 from the list, but i cant find solution, ive tried: PHP: $words = $this->cfg->get("Badwords");unset($words["word2"]);$this->cfg->set("Badwords", $words);$this->cfg->save(); but it dont seems to work... Any other ways?
PHP: $path = $this->getServer()->getDataPath()."plugins/MyPlugin/config.yml";file_put_contents(str_replace("- badword2", "", file_get_contents($path)), $path);
Instead Server::getDataPath() method, why not use directly getDataFolder()? PHP: $path = $this->getDataFolder() . "file.yml";
It's not a big deal, guys. Just unset the index. PHP: if(isset($this->cfg["Badwords"])){unset($this->cfg["Badwords"][0]);//unset word 1unset($this->cfg["Badwords"][1]);//unset word 2//etc...}