
Modrinth · Minecraft mod
Unruled API
Expands on the vanilla gamerules, adding new gamerules types for other mods to use and enabling players to set per-dimension overrides for gamerules
Quick answer
Which Unruled API release should I use?
Unruled API 2.3.3+26.2 targets 26.2 with Fabric, NeoForge. Do not install it on the client. It must be installed on the dedicated server. No extra mods listed for this file.
Where it goes
Is Unruled API required on the client, server, or both?
Do not install it on the client. It must be installed on the dedicated server.
This file is marked server-only.
What else does Unruled API 2.3.3+26.2 need?
2.3.3+26.2. Change the file and its required mods may change too.
This file does not list any required mods. Do not add a library just because a different file uses it.
This file does not list any required or optional mods.
Before you install it
Add Unruled API without breaking your instance.
Built for Unruled API 2.3.3+26.2. Pick another file and the loader, install side or required mods may change.
- 01
Stick to this file
Use 2.3.3+26.2. It targets 26.2 with Fabric, NeoForge; another release may have different loader, side or dependency requirements.
- 02
Bring the mods it needs
This file does not list any required mods. Do not add a library just because a different file uses it.
- 03
Put it on the correct side
Do not install it on the client. It must be installed on the dedicated server.
- 04
Pick the file you checked
Use the “Get this file” button beside 2.3.3+26.2. It opens that exact file at the source.
About this project
What does Unruled API add?
Unruled API

Allows to create new form of gamerules, beyond the restrictive vanilla integers and booleans.
This mod enables developers to easily create new floating, long, double, string, text, enum-driven,
entity selector and even registry-entry gamerules, using their respective builders,
all available from the com.nerjal.unruled_api.UnruledApi class's static methods.
It also provides means to add value validators alongside registering new gamerules, which in turn
allows to restrict the range of valid values for gamerules. For instance, it can be used to only allow
odd values in an integer gamerule.
Additionally, this mod also adds per-dimension gamerule overrides! These are applied in their
strict dimension (provided they are queried correctly).
See gamerules overrides for more details about it.
Gamerules registration
Example:
import com.nerjal.unruled_api.UnruledApi;
public class MyClass {
private static final int STRING_RULE_MAX_LENGTH = 24;
public void gamerulesRegistration() {
var myFloatingRule = UnruledApi.floatRuleBuilder(category, 1.5) // takes the category and the initial value as arguments
// the category determines where in the world creation screen will it be placed
.register("mymod:my_gamerule"); // gamerule registration always takes the gamerule's ID
// the ID also determines the translated name of the gamerule
var myStringRule = new StringRule.Builder(category, "initial value", STRING_RULE_MAX_LENGTH)
// using the UnruledApi methods or directly creating the builder has the same result, and arguments are the same.
// however, mind that in some cases, it is strongly recommended to use the specified builders such as for string
// rules, enum, and dynamic registry entry rules, as they have a more specific processing of their values and
// command handling.
.register("mymod:my_other_gamerule");
}
}
Additionally, quick creation and registration methods have been added for your convenience
import com.nerjal.unruled_api.UnruledApi;
public static void quickGamerulesRegistration() {
var myLongRule = UnruledApi.registerLong(Identifier.of("mymod:my_long_rule"), category, 25L);
// Quick registration methods always follow the same parameter order: name, category, initial value, gamerule-type specific arguments
// Except for enum rules, for which the enum class goes before the initial value
var myEnumRule = UnruledApi.registerEnumRule(Identifier.of("mymod:my_enum_rule"), category, MyEnum.FIRST, MyEnum.class);
}
enum MyEnum {
FIRST,
SECOND,
THIRD
}
For consistency, methods have also been created to allow quickly register vanilla-type gamerules.
import com.nerjal.unruled_api.UnruledApi;
public static void registerBasicRules() {
UnruledApi.registerInteger("my_int_rule", category, 5);
UnruledApi.registerBoolean("my_bool_rule", category, false);
}
You can also retrieve their values using the same class's methods
This has become outdated since release 2.0 (for Minecraft 1.21.11 and later).
Please use the gamerule methods directly as now meant by the game code.
public long getMyLongGamerules(ServerWorld dimension) { // ServerWorld is a Yarn mapping class. Might be Level or ServerLevel with Mojmap
return UnruledApi.getLong(dimension.getGameRules(), myLongGamerule);
}
public Block getMyBlockRule(ServerWorld dimension) {
// querying a registry entry rule returns the registry entry's very value, as it can only be set if it exists in the registry
return UnruledApi.getRegistryEntry(dimension.getGameRules(), myBlockRegistryEntryRule);
}
Command Tweaks
The average experience of using gamerules in vanilla minecraft is pretty poor.
Navigating a long list of names, trying to remember the one of the rule you need,
or even worse, searching for a hypothetic one, can be pretty annoying.
Thus, Unruled API aims to alleviate that burden ever so slightly, by allowing you
to navigate the same list by category!
Hence, you can now add the category name or full ID (both in full caps) in the command and the following
list will only contain rules in the appropriate category.
E.g. /gamerule CHAT will then have your game suggest you only the rules inside the
chat category, according to the world creation menu listing.
This also applies to all modded gamerules and categories, as well as modded gamerule types
from any and all mod.
/gamerule [<category NAME or FULL ID>] <gamerule name or ID> [<value>]
Gamerules Overrides
Gamerules overrides are set per dimension. They allow players to set specific rules to specific values
in the wanted dimension, all via the gamerule-override command.
This command has many uses:
gamerule-overridealone and with no arguments allows you to get a list of existing overrides in the current dimension.gamerule-override <dimension id>allows you to get a list of existing overrides in the specified dimension.gamerule-override get <gamerule id>allows you to query a potential override for the specified gamerule in the current dimension.gamerule-override set <gamerule id> <value>allows you to set an override for the specified gamerule to the given value in the current dimension.gamerule-override unset <gamerule id>allows you to remove a set override for the specified gamerule in the current dimension.gamerule-override in <dimension id> get <gamerule id>allows you to query a potential override for the specific gamerule in the given dimension.gamerule-override in <dimension id> set <gamerule id> <value>allows you to set an override for the specified gamerule to the given value in the provided dimension.gamerule-override in <dimension id> unset <gamerule id>allows you to remove a set override for the specified gamerule in the provided dimension.
Gamerule overrides are stored in the dimension's data folder, as the gamerules.dat file.
Removing it while the server is offline/world is not being played will simply remove all overrides for the dimension.
Additionally, for your convenience, the get, set and unset in all cases also
support the per-category filtering, for easier usage.
You can thus use the command as follows:
/gamerule-override in <dimension id> set [<category NAME or FULL ID>] <gamerule name or id> <value>
Configurable Default Values
Especially relevant for modpack creators, this feature allows to set custom values to be used as default gamerule
values upon world creation.
In order to set them, you only need to create a config/default_gamerules.json file, and for each gamerule you want
to add a default value for, set a key-value pair with the wanted new value, set as a string. (due to limitations in
the mojang code for easy JSON-parsing, only string values are accepted, anything else will simply be ignored)
Example:
{
"doDaylightCycle": "false",
"mobGriefing": "false"
}
Obviously, this works just as well with modded gamerules and gamerule types!
Custom Gamerule Categories
As of 1.21.11, gamerule categories are now a registry. The following is only relevant to game versions prior to this
Developers can easily register new custom gamerule categories, that will be added straight to the category enum!
However, you do need it to be done early in the game load process, i.e. before the gamerules class gets loaded.
This can be done on Fabric with a preLaunch entrypoint, on (Neo)Forge upon initializing your @Mod class,
or on any launcher from your mixin config plugin.
You only need to add a CategoryProvider implementation to the UnruledEarlyUtils.CATEGORY_PROVIDERS set.
The CategoryProvider interface is a String supplier-like class, that allows for an optional implementation of a
category consumer upon creation of the matching category. The provided String will be set as the category name, but
will not allow for duplicate entries (i.e. if two mods want to add a same category, only one will be created, but both
providers will receive it as well)
How to use in your project
You can implement this mod in your project using the Modrinth maven. Don't hesitate to read the official documentation.
Add the Modrinth maven repository
repositories {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
Import the mod
loom example:
dependencies {
// using modApi allows your project's dependents to also import dependencies by default
modApi "maven.modrinth:unruled-api:${project.unruled_version}"
}
(neo)forgeGradle example:
dependencies {
implementation "maven.modrinth:unruled-api:${project.unruled_version}"
}
For copyright reasons, we require you to not include (JiJ, jar-in-a-jar, shadow, etc) this mod inside of your own. Thank you for your comprehension.
Project description from Modrinth.
Pick your setup
Unruled API by Minecraft version and loader
Choose the version and loader you play, then open the matching release.
26.1.2
2 loader builds26.1.1
2 loader builds26.1
2 loader builds1.21.11
2 loader builds1.21.10
2 loader builds1.21.9
2 loader builds1.21.8
3 loader builds1.21.7
3 loader builds1.21.6
3 loader builds1.21.5
3 loader builds1.21.4
3 loader buildsShowing the newest 12 of 31 game versions. Older files are in the list below.
Check the dependencies, then try the file in a copied instance before changing a world you care about.
Recent files
Unruled API versions and loaders
2.3.3+26.2
unruled_api-unruled-api+26.2-2.3.3.jar
20 Jun 2026
2.3.3+26.1
unruled_api-unruled-api+26.1-2.3.3.jar
17 May 2026
2.3.2+26.1
unruled_api-unruled-api+26.1-2.3.2.jar
22 Apr 2026
2.3.1+26.1
unruled_api-unruled-api+26.1-2.3.1.jar
21 Apr 2026
2.3+26.1
unruled_api-unruled-api+26.1-2.3.jar
20 Apr 2026
2.2+26.1
unruled_api-unruled-api+26.1-2.2.jar
15 Apr 2026
2.1-1.21.11+neoforge
unruled_api-neo+1.21.11-2.1.jar
5 Jan 2026
2.1-fabric+1.21.11
unruled_api-fabric+1.21.11-2.1.jar
5 Jan 2026
2.0.3-1.21.11+neoforge
unruled_api-neo+1.21.11-2.0.3.jar
5 Jan 2026
2.0.3-1.21.11+fabric
unruled_api-fabric+1.21.11-2.0.3.jar
5 Jan 2026
2.0.2-1.21.11+neoforge
unruled_api-neo+1.21.11-2.0.2.jar
3 Jan 2026
2.0.2-1.21.11+fabric
unruled_api-fabric+1.21.11-2.0.2.jar
3 Jan 2026
Looking for an older file? The official Modrinth project page is in Resources.