Cloth Config API Mod

Creator
Publisher
Watch a video

Cloth Config API (also Auto Config) is a config API that allows the player to change the config of the game from Within the Game’s GUI. It is one of the most popular config APIs, and it is made by shedaniel, the author of Architectury API and Roughly Enough Items, and other big names. They have excellent documentation for Developers and are lightweight for players. There are also similar APIs, such as Cloth API, a general-purpose API for Fabric (distinct from Cloth Config/Cloth Config API) and Cloth Math, a Maths API that is not dependent on Minecraft.


There are multiple versions of Cloth Config, each of which has its API and Features. Each version of Cloth Config is linked to a specific version family of Minecraft.

Here is the Table:

  • V1 1.14.x (No Longer Developed)
  • v2 1.14.x-1.15.x (No Longer Developed)
  • v3 1.16 Snapshots before 20w17a (No Longer Developed)
  • v4 1.16.x 20w17a and newer (Supported)
  • v5 1.17.x (Supported)
  • v6 1.18.x (Supported)
  • v7 1.19 (No Longer Developed)
  • v8 1.19.x (Supported)


All stable versions of Minecraft have been supported since 1.16.


 It is important to note that Cloth API is not a fully functional config library; it is just a screen for setting the config, which shedaniel claims the others suck. Since Cloth is just a screen, it can work with existing APIs such as Forge Config API. It is also supposed to be primarily used with the client; however, some server features do exist, but it is suggested server mods do not use Cloth Config.


Cloth was initially designed with Fabric in mind because, at the time, Fabric was very lightweight and did not have much in the way of config, but it eventually got popular and was ported to Minecraft Forge.


For Players, install the mod like any other mod. Some mods may need Mod Menu to show configs where you edit the config from the Mod Menu entry.


For Developers, Cloth Config has many features such as Drop Down Menus, Integration with Mod Menu, Categories, and more.


Creating a Screen in your mod is easy and can be done with a single line of code.

```ConfigBuilder builder = ConfigBuilder.create()

.setParentScreen(parent)

.setTitle(new TranslatableText("title.examplemod.config"));

```

The Config Builder can be used to set the attributes of the Config Screen, such as the background, and is automatically localised with a translation key.


Note: a new builder is created every time the screen is opened.

```

builder.setSavingRunnable(() -> {

// Serialise the config into the config file. This will be called last after all variables are updated.

});


```

It saves the config to a file and requires custom parsing.

Entries are each different, and it is recommended you read the documentation for more details on creating entries and setup Cloth Config.


Another prominent feature of Cloth Config is Auto Config, which makes configuring your mod much easier with Annotations. Auto Config Annotations are flexible; they are put on top of Config files and have their annotations for fields, which can easily be set to whatever entry. e.g. @ConfigEntry.Gui.CollapsibleObject and can also be excluded @ConfigEntry.Gui.Excluded. The supported Field types by default are boolean, int, long, double, float, String, and enum.


Cloth Config is one of the most common Config Screens in Minecraft, so making your mod require it will not be a significant burden for most modpack devs, as many big mods, including many by Yung use it (such as Yung’s Better Dungeons).


Installation

Follow the procedures described below to install this mod into your game

  1. Download and install the Forge
  2. Download the mod
  3. Put the mod into .minecraft/mods folder
  4. Launch Minecraft
  1. Download and install the Fabric
  2. Install Fabric API
  3. Download the mod
  4. Put the mod into .minecraft/mods folder
  5. Launch Minecraft

Downloads

Release
Filename/Url
Game Versions
Modloader
Downloads
Updated
Actions
1.19.3
forge
2
January 13, 2023
1.19.3
fabric
3
January 13, 2023
1.18.2 1.18.1 1.18
forge
0
January 13, 2023
1.18.2 1.18.1 1.18
fabric
2
January 13, 2023
1.19.2 1.19.1 1.19
forge
8
January 13, 2023
1.19.2 1.19.1 1.19
fabric
3
January 13, 2023
1.16.5 1.16.4
forge
7
January 13, 2023
1.16.5 1.16.4
fabric
0
January 13, 2023
1.17.1 1.17
forge
0
January 13, 2023
1.17.1 1.17
fabric
0
January 13, 2023
1.16.2 1.16.3
fabric
0
January 13, 2023
1.16.2 1.16.3
forge
0
January 13, 2023
1.16.1 1.16
fabric
0
January 13, 2023
1.16.1 1.16
forge
0
January 13, 2023
1.15.2
fabric
0
January 13, 2023
1.15 1.15.1 1.15.2
forge
1
January 13, 2023
1.14 1.14.1 1.14.2 1.14.4
fabric
0
January 13, 2023
1.14.4 1.14.2 1.14.1 1.15.2
forge
0
January 13, 2023

Your evaluation

It helps us to improve our recommendation

0.0/5
0

Please sign in or create an account to participate in this conversation.

Log In Required

Accessing certain features in our website requires authentication

Sign In

Or if you do not have an account

Create an account
Are you sure to delete this comment?

Note that you cannot reverse this action.

Report an issue

First, please select the reason why you are reporting.

Copyright Infringement
Inappropriate Description
Bug
Other

Also please leave your email, so we can get back to you:

Please provide a valid email adress!
Post is saved to your bookmarks.
Report is sent!
Mod version does not match with the version of selected modpack
Select the language

After changing the language website content will be completely translated to the selected language and you can view translated versions of available posts.