HI, So I can set the players name to "test" to a config by doing Code: $this->getConfig()->setNested("test", $player->getName()); But how can I remove "test" from config? Iv tried Code: unset($this->getConfig()->getAll()["test"]); But nothing happens. Please help.
PHP: $this->getConfig()->remove("test"); OR, if you'd like to make use of unset, you can PHP: $cfg = $this->getConfig()->getAll();unset($cfg["test"]);$this->getConfig()->setAll($cfg); Source: Config.php
The second one is not useless. The code takes the entire config as an array, unsets the specified key then sets the entire config data with the updated array. Please think before posting, in the future people will come searching for answers and if they see incorrect information they'll be mislead.
i doesnt said that the second one doesnt work, i only say that they should use the Config::remove(); method ^^
When did I say that you said 'the second one' doesn't work? I was correcting your incorrect assumption of @Muqsit's second example method being useless. Can we not argue about who said what? There's no point taking the thread off topic just because of incorrect assumptions and personal opinions.