Skip to content

ConfigAPI

DarthBoomerPlay edited this page Apr 13, 2020 · 1 revision

ConfigAPI

This utility helps to work with configs.
Version Support: 1.8 - 1.15.1

public void create() // creates a config

public File getFile() // get File

public void saveFile() // save config

public String getString(String path) // get string
public List<String> getStringList(String path) // get string list
public ConfigurationSection getConfigurationSection(String path) // get configuration section
public Double getDouble(String path) // get double
public Float getFloat(String path) // get float
public Integer getInteger(String path) // get integer
public boolean getBoolean(String path) // get boolean (true/false)

public void set(String path, Object value) // set the value in the config
public void addDefault(String path, Object value)

//
// Example of usage:
//

ConfigAPI config = new ConfigAPI("data.yml", "plugins/DarthCore");
config.create();
if(config.getBoolean("debug") == true) {
     config.set("enabled", false);
}
config.saveFile();
Clone this wiki locally