Hi everyone. I am in the middle of developing a plugin, and got stuck with making a .yml file where all the data is sent. Notice that I am asking how to do it for NEW API, not the old one. So, how to make a .yml config file with the new API?
PHP: use pocketmine\utils\Config;$conf = new Config("directory/file.yml", Config::YAML, array("swag"=>"yolo")); Functions like Config::set etc are the same.
Look at CustomRanks. Create a folder at the plugin folder called "resources", and then create file config.yml. In onEnable() of the plugin, add this line: PHP: $this->saveResource("config.yml", false); config.yml is not a fixed name.
Just so you know, there's a way to load a config file without needing to code it in php. Simply write the config file how you want it to look, then place it in a folder called "resources" in your plugin's folder, and then in onEnable, there's a way to call on the config. Simply write: PHP: $config = $this->getConfig();$this->example = $config->get("Example");