Simple Config

Quick rating

Community listing page, reviews here may not be monitored by the author.

Simple Config

By TondoaOwner

No reviews yet

Simple Config is a Kotlin Fabric Minecraft mod that allows you to easily manage your mod's configuration. It provides a simple and intuitive API to read and write configuration data. The data will be serialized with the JSON format.

Mod Loaders
Fabric
Minecraft

Community voices

Reviews

List view
Grid view
Compact view
Sort by
Date
Rating
Helpful
Unhelpful
Edited
Sort ascending
Show per page
10
25
50
Delete this review?

This removes your review from the project. You can write a new review after.

Review submitted for moderation

Your review has been sent to moderators, who will check that it meets our guidelines before it appears publicly.

No reviews yet. Be the first to review this project!

Get it on

Available Platforms

Compatibility

Supported Environments

Where It Runs
Either Side, Better on Both

Works on the client or the server alone, but does more when on both.

About

Project Details

Type
Mod
License
MIT License
Latest Version
1.0.0

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.

Custom banner text
ModDex rating badge preview

Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.

Identifiers

Platform IDs

Modrinth ID

Resources

External Links

Source Issues Wiki Discord

About

Description

Simple Config

Simple Config is a Kotlin Fabric Minecraft mod that allows you to easily manage your mod's configuration. It provides a simple and intuitive API to read and write configuration data. The data will be serialized with the JSONformat.

Usage

Here's a basic example of how to use Simple Config:

object TutorialMod : ModInitializer {
  private val logger = LoggerFactory.getLogger("tutorialmod")

  override fun onInitialize() {
  
    //Access Data
    MyConfig.data.someNestedObject.someData
    MyConfig.data.someString // returns "hello"
    
    //write Data
    MyConfig.patch {
      someString = "Hello World!"
      someNumber = 0.07
    }
    
    MyConfig.data.someString // returns "Hello World!"
    
    logger.info("Hello I am using Simple Config!")
  }
}

When you write data using the patch method, it will automatically be written to the file.

Command

You can also reload your config with /simpleconfig [fileName] command or you can reload all Simple Config's with the /simpleconfig all command.

Configuration

To create a config, you need to create an object that extends SimpleConfig<T>. T can be any class as long as it has the @Serializable annotation. You must override fileName!

Here's an example:

object MyConfig: SimpleConfig<SomeDataClass>(defaultValue = SomeDataClass()) {
  override var fileName = "tutorialmod_config"
}

@Serializable
data class SomeDataClass(
  var someNumber: Double = 2.0,
  var someString: String = "hello",
  var someNestedObject: SomeNestedClass = SomeNestedClass()
)

@Serializable
class SomeNestedClass {
  var someData = LocalDate.parse("2024-01-01")
}

Optional values you can override:

Options Description default
fileEnding The file extension that should be used ".json"
path The path the config will be written to FabricLoader.getInstance().configDir
createReloadCommand Should Simple Config register a reload command true
json The Json settings used for the serialization Json { prettyPrint = true; encodeDefaults = true }

Gradle Setup

To set up Simple Config via Gradle, add the following to your build.gradle file:


plugins {
  [...]
  id 'org.jetbrains.kotlin.plugin.serialization' version '1.9.22'
}

repositories {
  [...]
  maven { url 'https://jitpack.io' }
}

dependencies {
  [...]
  modImplementation 'com.github.JonasSeifried:SimpleConfig:1623553e8f'
}

Troubleshooting

If you encounter any issues while using Simple Config, please check the GitHub issues page. If your issue is not listed there, feel free to open a new issue.

License

Simple Config is licensed under the MIT License.

Screenshots

Gallery

  • Reload Commands
    Reload Commands

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.

On ModDex

Community snapshot

0
Ratings
0
Followers
0
In stacks

By the numbers

Statistics

<1,000
Downloads
Last Updated
CurseForge
Modrinth
Created
Last synced
When ModDex last fetched this project from CurseForge or Modrinth. Every project is re-checked on a schedule, and any project that ships a new file is synced automatically within hours of the release.
New file updates sync automatically
How syncing works