Configs
The below snippet showcases how to use the Config API:
public class MyPlugin implements JavaPlugin {
@Override
public void onEnable() {
Config cfg = new Config("plugin_id", "config_name", "optional_subfolder_argument");
Config.Value<String> myStr = cfg.value("some.key", defaultValue);
myStr.get(); // Gets value
myStr.set(str); // Sets value
}
}
optional_subfolder_argument
can be omitted, config_name
is the config files name without .yml at end.
03 October 2025