About Unruled API
From ModrinthExpands on the vanilla gamerules, adding new gamerules types for other mods to use and enabling players to set per-dimension overrides for gamerules
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:
Highlights
From source dataGame versions
Supports 32 Minecraft versions, the newest being 26.3.
Loaders
Runs on Fabric, Forge, NeoForge and Quilt.
Footprint
Rated a light load on a server.
What kind of mod it is
From the catalogLibraries & compatibility
Foundations and fixes other mods build on. Usually installed because something else needs it.
Runs on your server
From source side supportModrinth lists Unruled API as required on the server. Check its Modrinth page to see whether players need it too.
Compatibility
- Game
- Minecraft
- Loaders
- FabricForgeNeoForgeQuilt
- Runs on
- Serverrequired on the server
- Game versions
- 26.3 and 31 earlier
Verified at the source
- ✓ModrinthOfficial listing, checked 2026-10-01Open ↗
- ✓AuthorNerjal_Nosk, as published on Modrinth
- ✓LicenseGPL-3.0-or-laterFree









