Mod

JasonConfig

Quick rating

JasonConfig

No reviews yet

A replacement for Forge's Config system, powered by JSON

No Theme
No Genre
QoL & Tweaks
API/Library
Mod Loaders
Forge
NeoForge
Minecraft

Community voices

Reviews

Versions
Loading versions…
Match includes

Click once to include, again to exclude, again to clear

Rating Any
Any 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0
Min
Max
Play Status
Reviews
Time Played
hrs+
Verified developers only
Has developer response
List view
Grid view
Compact view
Sort by
Date
Rating
Helpful
Unhelpful
Edited
Sort ascending
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

Dev Environment
Client Optional
Server Optional

About

Project Details

Type
Mod
License
MIT License
Latest Version
jsconf-1.1.1-1.21.1.jar
Authors
CurseForge
Modrinth

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

CurseForge ID
Modrinth ID

Resources

External Links

Source Issues Wiki Discord

About

Description

This is a LIBRARY mod, if you are a user just INSTALL it, do not read below! 

For Developers ---

Adding the dependancy [

    Just use CurseMaven, the repository for that is here, https://www.cursemaven.com/
    Add the dependency using the snippet in the needed version in Files

    example (not the right mod)
    implementation "curse.maven:cloth-config-348521:5987045"

]

Pros and Cons vs Forge's config

-Pros ----------------------------------

  • Uses JSON instead of TOML, making it more reliable (For example, Forge Configs do not easily support empty lists and can break when using them)
  • Compatible with reading and writing many more Java / Minecraft classes than Forge configs (For example, Vec3 cannot be written or read to a forge config, JasonConfig has no issues with it because of JSON objects)
  • Simpler to write in code while still being similar to how you create Forge config classes (see below)

-Cons ----------------------------------

  • Slightly less user readable because its in JSON format
  • Experimental, while I havn't found bugs yet I'm sure some will come, I'm only one guy after all
  • No sided configs, technically while if you just use a value on one side, it'll take that side's version of the config (so dedicated server and client specific configs should work fine), there are no configs per world like "serverconfigs" work

 

Example Config (Can also be found in the "api" package of the mod once you add it to your dependencies)

Everything you need in the "api" package is well documented and should be referred to

public class SimpleExampleConfigClass {
public static final Config EXAMPLE_CONFIG = new Config(MODID + "-example_config");
///The following config values are called with the {<code>EXAMPLE_CONFIG</code>} Config passed in, this automatically adds it to the Config
public static final ConfigValue<Float> EXAMPLE_FLOAT = new ConfigValue<>(10f, "exampleFloat", EXAMPLE_CONFIG);
///Comments are placed in order of declaration, so this comment will be below {<code>EXAMPLE_FLOAT</code>} and above {<code>EXAMPLE_LIST</code>}
public static final ConfigComment EXAMPLE_COMMENT = new ConfigComment("This is a list!", EXAMPLE_CONFIG);
public static final ConfigValue<List<String>> EXAMPLE_LIST = new ConfigValue<>(List.of("value1", "value2", "value3", "value4"), "exampleList", EXAMPLE_CONFIG);
public static final ConfigComment VEC3_COMMENT = new ConfigComment("This is a Vec3! Many Java classes that don't work in Forge configs will work here!", EXAMPLE_CONFIG);
public static final ConfigValue<Vec3> EXAMPLE_VEC3 = new ConfigValue<>(new Vec3(123,123,123), "exampleVec3", EXAMPLE_CONFIG);

///This method must be called in your mod's Main class
/// You will need to call the {<code>register()</code>} method on the {<code>Config</code>} you declared
/// and add any {<code>ConfigValue<?></></code>} variables you created if you did not assign them in the constructor
public static void init()/* This method can be called anything, init(), register(), etc*/ {
EXAMPLE_CONFIG.register();

///EXAMPLES OF GRABBING VALUES
//EXPLICIT (Very similar to Forge's Config)
SimpleExampleConfigClass.EXAMPLE_FLOAT.get();
}
}

This is a LIBRARY mod, if you are a user just INSTALL it, do not read below!

For Developers ---

Adding the dependancy [ Just use CurseMaven, the repository for that is here, https://www.cursemaven.com/ Add the dependency using the snippet in the needed version in Files example (not the right mod) implementation "curse.maven:cloth-config-348521:5987045" ]

Pros and Cons vs Forge's config

-Pros ----------------------------------

Uses JSON instead of TOML, making it more reliable (For example, Forge Configs do not easily support empty lists and can break when using them)
Compatible with reading and writing many more Java / Minecraft classes than Forge configs (For example, Vec3 cannot be written or read to a forge config, JasonConfig has no issues with it because of JSON objects)
Simpler to write in code while still being similar to how you create Forge config classes (see below)

-Cons ----------------------------------

Slightly less user readable because its in JSON format
Experimental, while I haven't found bugs yet I'm sure some will come, I'm only one guy after all

Example Config (Can also be found in the "api" package of the mod once you add it to your dependencies)

Everything you need in the "api" package is well documented and should be referred to

public class ExampleConfigClass {
    public static final Config EXAMPLE_CONFIG = new Config(MODID + "-example_config");

    public static final ConfigComment DEVCOMMENT
            = new ConfigComment("This file is only generated in a Dev environment", EXAMPLE_CONFIG);

    ///The following config values are called with the {<code>EXAMPLE_CONFIG</code>} Config passed in, this automatically adds it to the Config
    public static final ConfigValue<Float> EXAMPLE_FLOAT
            = new ConfigValue<>(10f, "exampleFloat", EXAMPLE_CONFIG, new TypeToken<Float>(){}.getType());
    ///Comments are placed in order of declaration, so this comment will be below {<code>EXAMPLE_FLOAT</code>} and above {<code>EXAMPLE_LIST</code>}
    public static final ConfigComment EXAMPLE_COMMENT
            = new ConfigComment("This is a list!", EXAMPLE_CONFIG);
    public static final ConfigValue<List<String>> EXAMPLE_LIST
            = new ConfigValue<>(List.of("value1", "value2", "value3", "value4"), "exampleList", EXAMPLE_CONFIG, new TypeToken<List<String>>(){}.getType());
    public static final ConfigComment VEC3_COMMENT
            = new ConfigComment("This is a Vec3! Many Java classes that don't work in Forge configs will work here!", EXAMPLE_CONFIG);
    public static final ConfigValue<List<Vec3>> EXAMPLE_VEC3
            = new ConfigValue<>(List.of(new Vec3(123,123,123), Vec3.ZERO), "exampleVec3", EXAMPLE_CONFIG, new TypeToken<List<Vec3>>(){}.getType());
    public static final ConfigComment CLASS_COMMENT
            = new ConfigComment("This is a newly created class, records are the best way to hold data like this", EXAMPLE_CONFIG);
    public static final ConfigValue<LinkedHashMap<String, Info>> EXAMPLE
            = new ConfigValue<>(new LinkedHashMap<>(Map.of("information", new Info(1.0f, false, 8))), "example", EXAMPLE_CONFIG, new TypeToken<LinkedHashMap<String, Info>>(){}.getType());

    ///This method must be called in your mod's Main class
    ///
    /// You will need to call the {<code>register()</code>} method on the {<code>Config</code>} you declared
    /// and add any {<code>ConfigValue<?></></code>} variables you created if you did not assign them in the constructor
    public static void init()/* This method can be called anything, init(), register(), etc*/ {
        EXAMPLE_CONFIG.register();

        ///EXAMPLES OF GRABBING VALUES
        //EXPLICIT (Very similar to Forge's Config)
    }

    public record Info(float f, boolean bool, int integer) { }
}

Screenshots

Gallery

  • Jason Config Example
    Jason Config Example

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

3.8m
Total Downloads
CurseForge
3.6m
Modrinth
~180,000
Last Updated
CurseForge
Modrinth
Created
CurseForge
Modrinth
Last synced
When ModDex last fetched and imported data for this project from CurseForge or Modrinth. High-traffic and active projects are checked more often.
Next pipeline sync