HomeJavaModsKonfig: Easily add configuration to your plugin (API)
ModsJava

Konfig: Easily add configuration to your plugin (API)

⬇ Download on Spigot
Easily add configuration to your plugin with Konfig.

Maven:
Repo:
Code (Text):

<repositories>
  <repository>
    <id>bintray-simpleauthority-konfig</id>
    <url>https://dl.bintray.com/simpleauthority/konfig</url>
  </repository>
</repositories>
 
Dependency:
Code (Text):

<dependencies>
  <dependency>
    <groupId>com.algorithmjunkie.mc</groupId>
    <artifactId>konfig-?</artifactId>
    <version>1.0.1</version>
    <scope>compile</scope>
  </dependency>
</dependencies>
 
Change the ? to one of "core", "bukkit", or "bungee". Use core to reimplement Konfig for your platform. Use bukkit or bungee to use the library on either platform respectively.

Example :
Create a Konfig:
Code (Java):

public class TestKonfig extends BukkitKonfig {
    public TestKonfig ( JavaPlugin plugin ) {
        // place test.yml in plugin's data folder
        super ( plugin, "test.yml" , plugin. getDataFolder ( ) ) ;
    }
   
    // now create methods to access your data
    public String getAuthToken ( ) {
        return getString ( "auth-token" ) ;
    }
   
    public List < String > getBlockedUsers ( ) {
        return getStringList ( "blocked-users" ) ;
    }
}
 
Then use it:
Code (Text):

public class TestPlugin extends JavaPlugin {
    @Override
    public void onEnable() {
        TestKonfig konfig = new TestKonfig(this);
        String authToken = konfig.getAuthToken();
        List<String> blockedUsers = konfig.getBlockedUsers();
    }
}
 
That's it.
Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Konfig: Easily add configuration to your plugin (API) is a free Minecraft Java mod. Compatible with Minecraft 1.13. Downloaded 456 times (via Spigot). Download it and open it directly in the game.

Explore more