Easily add configuration to your plugin with Konfig.
Maven:
Repo:
<repositories>
<repository>
<id>bintray-simpleauthority-konfig</id>
<url>https://dl.bintray.com/simpleauthority/konfig</url>
</repository>
</repositories>
Dependency:
<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:
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:
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.
Maven:
Repo:
Code (Text):
<repositories>
<repository>
<id>bintray-simpleauthority-konfig</id>
<url>https://dl.bintray.com/simpleauthority/konfig</url>
</repository>
</repositories>
Code (Text):
<dependencies>
<dependency>
<groupId>com.algorithmjunkie.mc</groupId>
<artifactId>konfig-?</artifactId>
<version>1.0.1</version>
<scope>compile</scope>
</dependency>
</dependencies>
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" ) ;
}
}
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();
}
}
Quick facts
- Edition: Minecraft Java
- File type: .jar
- Minecraft version listed: 1.13
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Spigot — not every file is mirrored on our own servers.
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.