hey i have the problem that i want to save an array() in the Config but it fails every time when i started it . I have a resource folder with a config.yml and an other Config which spawns automatically ?Do you can help me in this Problem please ? PHP: <?php/*** * _ _ _____ __ __ _____ _____ _____ __ __ ______ ______* | | | |(_)|__ __|| | | || ___|| \ |__ __|| | | | | __ || _____|* | | | || | | | | |_| || |___ | (__) \ | | | | | | | |__|_|| |____* | |____| || | | | | _ || ___|| | | | | | | | | __ || ____| * | __ || | | | | | | || |___ | | \ | | | | |_| | | |__| || |____* |__/ \__||_| |_| |__| |_ ||_____||__| \_| |_| |_______| |______||______|* This plugin was made by WitherTube :D.* It was published on PocketMine-Forum , GitHub or Twitter ^^.* For upcoming News follow me on Twitter and maybe subscribe my channel :D.*** @author WitherTube* @link Twitter : https://twitter.com/WitherDevPE* @link YouTube : https://www.youtube.com/channel/UCBcXzwKx27T1OEXCU9_NZiQ* @link Pocketmine : https://forums.pocketmine.net/members/withertube.40392/* @link GitHub : it is disable :(**/namespace Withertube ;use pocketmine\plugin\PluginBase;use pocketmine\event\Listener;use pocketmine\event\player\PlayerChatEvent;use pocketmine\utils\Config;class ChatSafe extends PluginBase implements Listener { public $cfg; public $badwords = array();public function onEnable(){$this->getLogger()->info("wurde aktiviert");if (!is_dir($this->getDataFolder())) { mkdir($this->getDataFolder()); } $config = new Config($this->getDataFolder() . "config.yml", Config::YAML, ["badwords" => array( " bastard " , " flugzeuge " , )]);$this->reloadConfig();$this->config = $this->getConfig()->getAll();$this->getServer()->getPluginManager()->registerEvents($this, $this);}public function onChat(PlayerChatEvent $event){$msg = $event->getMessage();$badwords = $this->getConfig()->get("badwords");$neuersatz = str_ireplace($badwords,"****",$msg);$event->setMessage($neuersatz);}public function onDisable(){$this->getLogger()->info("wurde deaktiviert");} }//That is the main.php####################################### Plugin made by WitherTube#################################badwords: - bastard - flugzeuge//This is the Config.yml
Tons of solutions exist for the same question, just search: https://www.google.com/search?q=How to create a config with array() site:pocketmine.net