Custom Config - C00kier/CookiersLib GitHub Wiki

Utility for managing custom YAML configuration files in a Bukkit plugin. Supports loading, accessing, and saving configuration files outside the default config.yml.


Constructor

Constructor for creating a config handler.

CustomConfig(JavaPlugin plugin, String fileName)

Parameters:

  • plugin — your plugin instance
  • fileName — the YAML file name (e.g., "settings.yml")

Methods defined for Custom Config Object

Load config

Loads the YAML file from the plugin's data folder. If the file does not exist, it copies the default version from the plugin JAR.

loadConfig()

Get loaded config

Gets the loaded configuration object.

getConfig()

Returns:

  • The parsed FileConfiguration instance

Save config

Saves the current configuration to disk. Logs an error if saving fails.

saveConfig()