Installation:
- Click on Download
- Create a Config.java file in your project
- Copy the contents from gist to your class
- Check the Usage for more informations.
Download link leads you to a gist. Alternatively, you can click here.
(https://gist.github.com/RobiFox/9101eecb34f4a5078342ec762d739898)
Usage:
- Open your project and create a new Config file in the Main class
Config File
Config c = new Config("plugins/MyPlugin", "ExampleFile.yml", this);- Use the "create" method to create it.
Create Method
Config c = new Config("plugins/MyPlugin", "ExampleFile.yml", this);
c.create();- Create a file just like making "config.yml", and write your default paths there.
Example Picture

- Do an if statement for existence
Exist Statement
Config c = new Config("plugins/MyPlugin", "ExampleFile.yml", this);
c.create();
if(!c.exists()) { }- If not, set the file's default, copy them, and save it.
Existing check
Config c = new Config("plugins/MyPlugin", "ExampleFile.yml", this); // ExampleFile.yml is the output file
c.create();
if(!c.exists()) {
c.setDefault("ExampleFile.yml"); // Your file name in your jar file
c.getConfig().options.copyDefaults(true);
c.saveConfig();
}- Create a variable to make it available from other classes, and assign it, too.
Making it public static
public Config example;
public void onEnable() {
Config c = new Config("plugins/MyPlugin", "ExampleFile.yml", this);
c.create();
if(!c.exists()) {
c.setDefault("ExampleFile.yml");
c.getConfig().options.copyDefaults(true);
c.saveConfig();
}
example = c;
}- You can convert it to a file by doing: Config.toFile();
- You can convert it to YamlConfiguration by doing: Config.getConfig();
Similar projects
Config →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta