Configuration Files

Upvotes: 15
Supported MCreator versions
2022.3
EAP 2022.4.52117
EAP 2023.1.04717
Tags / plugin type
Procedures
Templates
configs
About the plugin

Configuration FIles is a plugin that allows for the creation of mod configuration files, through which parts of your mod can be enabled, disabled or modified using variable values stored inside it. Those values can then be changed by the mod's users, allowing for more control over your mod's features.

 

How to use?

 

Configurations are very simple to use. You will first need to create a configuration element.

config

Once created, you can make a configuration category and add variable types to it. Note that registry name types are considered texts. (and entities are not supported yet, but you can manually write the registry name as a text variable)

variables

You can then use the variables in procedures by following the example below.

example

 

And that's it! The Configuration Files will generate once the game is loaded.

 

The plugin supports versions 1.16.5-1.19.2, but doesn't support 2022.2. Therefore you will need to install the forge generator 1.16.5 plugin for 2022.3 if you plan on using this with 1.16.5

 

This is a Java Plugin and therefore requires the Java Plugins feature to be enabled.

 

 

Changelog

v1.4
-Deleted the 1.16.5 templates as that version is now unsupported in 2023.1
-Changed the variable getter procedures to use a datalist for selecting the configuration element
(You will need to select the element again in existing procedures)

v1.3

-Dropped support for 2022.4 snapshot 1 and below due to incompatibilities in the code
-Updated to the 2023.1 snapshot 2

v1.2
-Number variables can now have negative values
-Added the convert registry name to item procedure
-Added the convert registry name to block procedure

v1.1
-Fixed number variables causing build errors
-Fixed number variable procedure causing build errors
-Fixed configurations being part of the items list
-Fixed block and item registry name variables sometimes causing build errors
-Fixed configuration categories generating inside of each other
-Deleted some useless code in the configuration template
(File size is the same but I swear that's just a coincidence)
License
MIT License

Comments

Amazing!!

I had planned to do something like that but now I don't need to do that :)

@NerdyPuzzle if you have time are you could add "Anaku's Status Bars" Mod as a Java Plugin?

Here is the CurseForge Link of the Mod:
Fabric - https://www.curseforge.com/minecraft/mc-mods/anakus-status-bars
Forge - https://www.curseforge.com/minecraft/mc-mods/anakus-status-bars-forge

No the implementation of that just like the integration of JEI.

The Mod above I linked allowed us to make more easily an Status Bar aka. Health Bar etc. for your Attributes. In short you can make your own HUD Status Bar just like the Heart Bar etc.
This is really cool if this exist in MCreator via Java plugin.

Check the Documentation:
Forge: https://github.com/LordAnaku/Anaku_Status_Bars_Forge/wiki
Fabric: https://github.com/LordAnaku/Anakus_Status_Bars/wiki

This is very intuitive, i learned json trying to use the File Manager plugin, but this can be used by anyone and still make it work perfectly as it's simpler to use. Good job Nerdy

Adding an option to switch orders of the different elements would be great!

Is it possible to layer the categories beneath eachother? as whenever I try to add more categories they just add themselves inside the first one.

Fails to build with the 1.16.5 generator for 2022.3, like shown in this video https://www.youtube.com/watch?v=NB6VlLDOO6M

> Task :compileJava FAILED
C:\Users\*****\MCreatorWorkspaces\sakes_weapons\src\main\java\sakeplays\sakesweapons\configuration\SakesWeaponsCfgConfiguration.java:11: error: incompatible types: int cannot be converted to java.lang.Double
THUNDERCLAP_DAMAGE = BUILDER.comment("How much damage should thunderclap deal.").define("Thunderclap's Damage", (Double) 40);
^
1 error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 8s
1 actionable task: 1 executed

BUILD FAILED
Task completed in 16 seconds

another error when i want to get a variable:

> Task :compileJava FAILED
C:\Users\*****\MCreatorWorkspaces\sakes_weapons\src\main\java\sakeplays\sakesweapons\procedures\ThunderclapProjectileHitsLivingEntityProcedure.java:21: error: incompatible types: java.lang.Double cannot be converted to float
entity.attackEntityFrom(DamageSource.LIGHTNING_BOLT, (float) SakesWeaponsCfgConfiguration.THUNDERCLAP_DAMAGE.get());
^
1 error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 8s
1 actionable task: 1 executed

Perfect, love the new update! But I was wondering, is it possible to allow negative values in the config as well?

I was gonna do a merely convenient workaround variable system for my mod as a kinda-config, but then Nerdy surprised us yet again <3 Amazing plugin!

Another very good mod from you, thank you very much.
With "All Mods - FORGE ONLY!" and "Configured" it's perfect.

Can you add a block to use blocks and item? Of style :
ForgeRegistries.BLOCKS.getValue( new ResourceLocation(ConfigConfiguration.BLOCC.get()) )