Config X
A fabric API library for plugins to load & save configurations
No ratings yet
Be the first to rate it.
Community listing page
Community listing page, reviews may not be monitored by the author.
Community voices
Reviews
Log in to review this mod
Reviews are written by ModDex members. Log in and you'll come right back to the review form.
No reviews yet. Be the first to review this project!
Get it on
Available Platforms
About
Project Details
For authors
Embed Badge
If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.
Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.
Identifiers
Platform IDs
About
Description
Config X
Description
This is a fabric API library for plugins to load & save configurations.
Installation
Add the following to your build script:
repositories {
maven {
url = uri("https://repo.codemc.io/repository/tetoe-mc")
}
}
dependencies {
// Approach #1: Ensure Config X is always available by including it within your own jar
include(modImplementation("space.nocp:configx:2.0.1"))
// Approach #2: Depend on Config X, but require that users install it themselves
modImplementation "space.nocp:configx:2.0.1"
}
Then refresh your project.
Usage
Remember to import the package before starting.
import space.nocp.configx.api.*;
Register a configuration
Before registering a configuration, you need to write a class describing the configuration object and prepare a default configuration. Here, let's call the class ConfigType.
// ...
Configuration config = ConfigManager.get().register("my-config", defaultConfig, ConfigType.class);
Get a configuration
After registering your configuration, you can use config() method to get the configuration at anywhere in your project.
Configuration config = ConfigManager.get().config("my-config");
Get & set the configuration object
Configuration config = ...;
ConfigType configObj = config.get();
configObj.myValue = "Hello World";
config.set(configObj);
config.save(); // Remember to save the config after setting it
Load the configuration from the file system manually
Usually, the configuration is always up-to-date with the one storing in the file system. But sometimes, you may want to refresh it manually.
Configuration config = ...;
config.load();
Get the info of the configuration
Configuration config = ...;
String id = config.id; // my-config
config.getFileName(); // my-config.json
config.getPath().toString(); // C:/path/to/config/my-config.json
Use custom Gson to parse JSON
Config X stores your configuration in the JSON format. When you stores objects that requires custom serializers and deserializers, you need to build your own Gson to achieve this.
Before registering your configuration, you need to prepare your Gson in advance. Here, let's assume we already have a custom Gson object called myGson.
Just simply add the Gson object as a parameter after all the parameters in register() method, and the parsing operations will be done with the provided Gson.
// ...
Configuration config = ConfigManager.get().register("my-config", defaultConfig, ConfigType.class, myGson);
For more information about custom serializer and deserializer in Gson, see the article: Building a Personalized Serializer and Deserializer using Java Gson Library
Build from source
git clone https://github.com/tetoe-mc/configx.git
cd configx
./gradlew build
Then you can get the jar file in the build folder.
LICENSE
CC0 1.0
Screenshots
Gallery
Versions
Files
Relations
Project Relations
More like this
Similar Mods
Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.
- PTG x InYourWalls - Custom Level Colour Port
- Epic Fight x Paragliders Compat
- The Lost City x [ST] Drive
- The Lost City x Automobility
- ConfigurationsBackport
- Mobs no render
- Cloth Config API (Fabric/Forge/NeoForge)
- SuperMartijn642's Config Lib
- Fzzy Config
- Cloth Config API (UNUSED)
- Config Manager
- Config Swapper
Stats
- Downloads
- <1,000
- Used in
- 0 modpacks
- Followers
- 0
- In stacks
- 0
- Created
- Last synced
-
Nov 3, 2026 6:41 PM UTC
New file updates sync automatically.
When ModDex last fully re-synced this project from CurseForge or Modrinth. A new file release triggers a resync usually within minutes, and every project is also re-synced on a schedule. Edits that don't ship a file, such as a new description or screenshots, are checked every few hours and can appear before the above date changes.
How syncing works
External Links
Stats
- Downloads
- <1,000
- Used in
- 0 modpacks
- Followers
- 0
- In stacks
- 0
- Created
- Last synced
-
Nov 3, 2026 6:41 PM UTC
New file updates sync automatically.
When ModDex last fully re-synced this project from CurseForge or Modrinth. A new file release triggers a resync usually within minutes, and every project is also re-synced on a schedule. Edits that don't ship a file, such as a new description or screenshots, are checked every few hours and can appear before the above date changes.
How syncing works