ModsJava
SimpleJSONConfig – Smart JSON/YAML Configs & Data Stores for Bukkit/Spigot/Paper
SimpleJSONConfig Smart JSON/YAML configuration & data storage library for your Bukkit/Spigot/Paper plugins Create, manage and share configs with zero…
⬇ Download on Spigot
SimpleJSONConfig
Smart JSON/YAML configuration & data storage library for your Bukkit/Spigot/Paper plugins
Create, manage and share configs with zero boilerplate!
Smart JSON/YAML configuration & data storage library for your Bukkit/Spigot/Paper plugins
Create, manage and share configs with zero boilerplate!
✨ Main Features
- Create JSON or YAML configuration files for your plugins
- Persist your data in flat files using Data Stores
- Easily serialize your objects with a custom Serializer
- Shared adapters for cross-plugin functionality (SharedGsonBuilder)
- Add comments directly in your config with @comment annotation
- Autowire configs into static fields using @Autowired
- Share your configurations between plugins
- Specify custom configuration directory
- Built-in support for most crucial Bukkit/Spigot types:
- ItemStack
- Location
- World
- Block
- And more...
- Interfaces and superclasses support
- Reload specific config or all at once
- LRU cache for faster Data Store access
- Automatic config file updates when fields change in your class
Quick Start
1. Register SimpleJSONConfig in your plugin
Code (Java):
public class Main extends JavaPlugin {
@Override
public void onEnable ( ) {
// Default directory: YourPlugin/configuration/
SimpleJSONConfig. INSTANCE. register ( this ) ;
// Use YAML instead of JSON
SimpleJSONConfig. INSTANCE. register ( this, StoreType. YAML ) ;
// Specify custom directory
SimpleJSONConfig. INSTANCE. register ( this, new File ( "default/config/directory" ) ) ;
}
}
Code (Java):
@Getter
@Configuration ( "config" ) // or config.json / path/to/config
@SuppressWarnings ( "FieldMayBeFinal" ) // no final modifiers yet
public class MyConfig extends Config {
private String joinMessage = "Default join message" ;
private List <ItemStack > startingEquipment = new ArrayList <> (
Collections. singletonList ( new ItemStack (Material. DIRT ) )
) ;
@Comment ( "This comment will appear in the config file too" )
private YourType something ;
}
Code (Java):
// Option 1: Get directly
private MyConfig config = Config. getConfig (MyConfig. class ) ;
// Option 2: Autowire into static field
@Autowired
private static MyConfig config ;
Persist any object that implements Identifiable with just an annotation!
Code (Java):
@Stored (value = "directory", storeType = StoreType. JSON )
public class MyClass implements Identifiable <UUID > {
private final UUID id ;
private int count ;
@Override
public UUID getId ( ) {
return id ;
}
}
Code (Java):
private static Service <UUID, MyClass > service = Service. getService (MyClass. class ) ;
public void foo ( ) {
MyClass obj = new MyClass (UUID. randomUUID ( ) ) ;
service. save (obj ) ; // serialize to file
MyClass loaded = service. getById (obj. getId ( ) ) ;
List <MyClass > matching = service. getMatching (c -> c. getCount ( ) > 10 ) ;
service. delete (obj ) ;
}
- Exclude fields from serialization with transient modifier
- Serialize any object with the built-in Serializer
- Reload configs at runtime
- Enable LRU cache for Data Stores
- Customize Gson with your own type adapters via SharedGsonBuilder
- InterfaceAdapter support for complex polymorphic types
Maven & Gradle
Spoiler: Maven
<repositories>
<repository>
<id>jitpack.io </id>
<url>https://jitpack.io </url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.2DevsStudio </groupId>
<artifactId>SimpleJSONConfig </artifactId>
<version>1.4.1 </version>
<scope>compile </scope>
<!-- Or provided if you want cross-plugin config sharing -->
</dependency>
</dependencies>
Code (XML):
<repositories>
<repository>
<id>jitpack.io </id>
<url>https://jitpack.io </url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.2DevsStudio </groupId>
<artifactId>SimpleJSONConfig </artifactId>
<version>1.4.1 </version>
<scope>compile </scope>
<!-- Or provided if you want cross-plugin config sharing -->
</dependency>
</dependencies>
Spoiler: Gradle
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.2DevsStudio:SimpleJSONConfig:1.4.1'
// or compileOnly for cross-plugin config sharing
}
Code (gradle (Unknown Language)):
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.2DevsStudio:SimpleJSONConfig:1.4.1'
// or compileOnly for cross-plugin config sharing
}
Why use SimpleJSONConfig?
Because writing config handling by hand is boring.
With SimpleJSONConfig you can:
- Stop manually parsing JSON/YAML
- Stop worrying about missing or outdated config fields
- Share configurations between plugins easily
- Store your data in a clean and type-safe way
Make your plugin development faster, cleaner, and more enjoyable with SimpleJSONConfig!
Quick facts
- Edition: Minecraft Java
- File type: .jar
- Minecraft versions listed: 1.7, 1.8, 1.9
- 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.
SimpleJSONConfig – Smart JSON/YAML Configs & Data Stores for Bukkit/Spigot/Paper is a free Minecraft Java mod. Compatible with Minecraft 1.7, 1.8, 1.9, 1.10 and newer. Downloaded 297 times (via Spigot). Download it and open it directly in the game.