The Config object has a set() function that takes key and value arguments. The key would be "name.value2", the value would be whatever you wanted to set the key to. https://github.com/PocketMine/PocketMine-MP/blob/master/src/pocketmine/utils/Config.php
The way I would do it is like so: PHP: $array = $this->cfg->get("Name");$array["value2"] = "new_value";$this->cfg->set("Name", $array);$this->cfg->save(); Buuuutttttt... @Extreme_Heat's answer is probably more efficient.
That would be Code: name.value1: Hello If the config should look like the one you posted, "Name" would be empty. This is a YAML file, make sure to use spaces. Code: Name: value1: Hi value2: Bye Here, you can/have to use setNested(). PHP: $config->setNested("Name.value1", "Hey"); The dot basically tells the config to go into the next "dimension" of the array. Only at setNested() though.