> For the complete documentation index, see [llms.txt](https://julion-n.gitbook.io/bulb/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://julion-n.gitbook.io/bulb/configurations/adding-your-own-configuration.md).

# Adding your own configuration

The ConfigManager class contains methods that can be helpful when creating new configurations. To start, we will need to create a class that inherits from ConfigManager

```java
public class MyConfig extends ConfigManager<MyPlugin> {
    
    protected MyConfig(MyPluginplugin) {
        super(plugin);
    }
    
}
```

It is recommended to follow the singleton pattern within this class. A complete example would be:

```java
public class MyConfig extends ConfigManager<MyPlugin> {

    private static MyConfig INSTANCE;

    private MyConfig(MyPlugin plugin) {
        super(plugin);
    }

    public static MyConfig register(MyPlugin plugin){
        MyConfig config = new MyConfig(plugin);
        config.tryLoad("myconfigfile.yml", ((configFile, configuration) -> {
            ...
        }), ((configFile, configuration) -> {
            ...
        }));
        INSTANCE = config;
        return INSTANCE;
    }

    public static MyConfig getInstance(){
        return INSTANCE;
    }

}
```

Now, within the register method, use the tryLoad method to load a new configuration.
