Jump to content

Config files with Lists


Recommended Posts


I have created a Forge Mod, that uses a config file and the Configuration method from minecraftforge. The mod is client-side only, it has some visual features. The .cfg file exists and has every variable in it, almost correct.

Now to the problem: Some of the variables are Lists of Integers and Booleans. But I can't save the variables in the file a proper way. A normal method call would be:

    this.config.get("category", "key", new Boolean[7]).set(this.key);

The output in the config file would be something like:

    category {








The syntax of the IDE (IntelliJ) seams to be correct, it suggests to use (String, String, boolean[], optional others) but it only let me do:

    this.config.get("category", "key", new String[7]).set(this.key);

A list of Strings works without a problem and but thats not what I want. I can only use Integers, Doubles and Booleans if they are not lists.


Does someone has a solution or a guess? And before you say that I should use a toml, json, yaml... file: I've already integrated everything and it would be a lot of work. Besides that its the way you should do it according to Forge:

Thanks, Matrix

Link to comment
Share on other sites

This topic is now closed to further replies.


  • Create New...

Important Information

By using this site, you agree to our Terms of Use.