RandomConfigs
Introduction
RandomConfigs is a utility mod that provides the ability to set default configuration settings, game rules, difficulty levels, and world borders. When installed on the client, it is fully compatible with vanilla servers, and when installed on the server, it is compatible with regular clients. This also means that the client can connect with a different version of the mod compared to the server.
Configuration Features
The mod reads an array of objects from the file config/randomconfigs/defaultconfigs.json, written in the following format:
[
{
"source": String,
"destination": String,
"side": ConfigSide,
"version": int
}
]
The "source" parameter points to any file in the config/randomconfigs/defaultconfigs folder.
"destination" refers to any file in the Minecraft directory.
"side" can take the values "client", "server", or "both".
The file specified in "source" is copied to "destination" if the target file does not exist.
"version" represents an integer value. When "version" changes, the configuration is forcibly updated. This is useful if you have already included a default configuration in your modpack and want to make changes.
Game Rules and World Settings
RandomConfigs allows setting default game rules depending on the game mode and world type. It is also possible to set the default world border size and difficulty level, as well as forcibly set game rules so they cannot be changed. Default game rules are stored in config/randomconfigs/defaultgamerules.json.
Attack Speed
The mod allows configuring different attack speeds for specific items. Additionally, attacks can be disabled during the cooldown period. The attack speed configuration is stored in config/randomconfigs/attackspeeds.json.
Attack speed controls the duration of the cooldown time. The time is calculated as 1 / attack speed * 20 ticks. Tools have their own attack speed modifiers, meaning different speeds depending on the tool being used.
The attack speed configuration can be reloaded using the commands /asreload and /asreloadclient.
Technical Features
RandomConfigs uses Jankson for JSON processing, which fixes various inconsistencies such as missing commas and omitted quotes.