This Code is wrong. Rcon says is a undefined variable , but i have a public Variable on this name. PHP: public $badWords = array( "spast", "depp", "noob", "noop", "arsch", "scheiße", "fuck you", "scheiß server", "arschloch", "dummkopf", "depp" ); public function onEnable() { $this->getLogger()->info("wurde aktiviert"); @mkdir($this->getDataFolder()); $cfg = new Config($this->getDataFolder(). "BadWords.yml", Config::YAML); if(empty($cfg->get("BadWords"))) { $cfg->set("BadWords", $badWords); $cfg->save(); } }
Learn OOP and php, No like for real i am not saying this just because it is cliche thing to say And i am backing it up with the fact that that's now how you access a property
PUT THIS IN THE FACEPALM SECTION! Anyway, the reason that it's giving an error is because of the variable you are using to set the "badwords" PHP: public $badWords = array( "spast", "depp", "noob", "noop", "arsch", "scheiße", "fuck you", "scheiß server", "arschloch", "dummkopf", "depp" ); public function onEnable() { $this->getLogger()->info("wurde aktiviert"); @mkdir($this->getDataFolder()); $cfg = new Config($this->getDataFolder(). "BadWords.yml", Config::YAML); if(empty($cfg->get("BadWords"))) { $cfg->set("BadWords", $this->badWords); // use $this->badWords instead of $badWords because it's a global variable $cfg->save(); } }
Than comes an error: Warning: yaml_edit(): Invalid UFT-8 sequence in argument in phar: emuleted/0/PocketMine/PocketMine-MB.phar/src/pocketmine/utils/Config.php on Line 195.