Save current values

So users don't complain their changes aren't persisted.

You can save config current values to the disk with a single method call.

Remember that sc-cfg already creates a file with the default values whenever you get the config instance for the first time, so this method should only be used if you modified the values of your config instance and want to persist them to the disk.

import com.github.secretx33.sccfg.Config;

public class MyPlugin extends JavaPlugin {

    @Override
    public void onEnable() {
        MyConfig config = Config.getConfig(MyConfig.class);
        
        // save your config current values by using
        Config.saveConfig(config);
        // or
        Config.saveConfig(MyConfig.class);
    }
}

Last updated