how i add something to config MY CODE dont work PHP: publicfunction onBreak(BlockBreakEvent $e){ $p = $e->getPlayer(); $world = $p->getLevel()->getFolderName(); $cfg = new Config($this->getDataFolder()."config.yml", Config::YAML, array()); if (in_array($p->getLevel()->getFolderName(), $this->getArenas())) { $e->setCancelled(); $p->sendMessage(C::GREEN . "You can not break blocks!"); $cfg->set("Number", 1); $cfg->save(); return; }}
PHP: $conf = new Config($this->getDataFolder() . "config.yml", Config::YAML);$conf->set("Number", 1); $conf->save();
If you want to add something at the end of an array use this: PHP: $array = $this->array; array_push($array, "This is what you want to add"); $this->array = $array; $conf->set("Numbers", $array);
4 posts in row? Please use edit button. That doesn't change anything because an empty array is used anyways. Check out for yourself in Config.yml