-
Notifications
You must be signed in to change notification settings - Fork 0
Creating your first custom configuration file
Leonardo Luiz Gava edited this page Dec 26, 2022
·
10 revisions
As with the default config.yml file, you will need to create a new one in your project's resources folder. Neelix accepts YAML or JSON formats.
resources/custom_config.yml
# This custom config accept comments and will be copied when registered!
my-option: 'You can configure this file how you want'
my-plugin-is-amazing: trueWhen the configuration file is created, it must be registered by the plugin.
There are two ways to register the created file:
main plugin class
public class MyPlugin extends JavaPlugin {
private static CustomYamlConfig exampleYAML;
@Override
public void onEnable() {
// Use CustomConfig.JSON to register JSON files.
exampleYAML = new CustomConfig.YAML(this, "example.yml", true).build();
}
public CustomConfig getExampleConfig() {
return exampleYAML.getConfig();
}
} main plugin class
public class MyPlugin extends JavaPlugin {
private static CustomYamlConfig exampleYAML;
@Override
public void onEnable() {
// Use CustomJsonConfig to register JSON files.
exampleYAML = new CustomYamlConfig(this, "example.yml", true).build();
}
public CustomConfig getExampleConfig() {
return exampleYAML.getConfig();
}
} Should I include the extension of the file? Yes.

Creating your first custom configuration file
Creating your first subcommand
- Introduction
- Creating subcommand class
- Registering subcommands on parent command
- Registering parent command
- Using subcommand as CommandExecutor
Creating subcommand fail listener
Creating Custom Inventories WIP 🚧
- Introduction
- Creating your first Simple Inventory
- Creating your first Paginated Inventory
- What is the locked slots parameter?
- Creating Inventory Items
- Creating Custom Navigation
- Registering your inventories