LibGamerule: The Essential Custom Gamerule Library for Minecraft

LibGamerule empowers modders and pack makers to add custom gamerules to Minecraft Fabric effortlessly. Download LibGamerule for Minecraft to unlock new gameplay possibilities.

Download libgamerule for Minecraft 1.16.1, 1.16-Snapshot, 1.15.2

Original name: libgamerule

Minecraft: 1.15.2, 1.16-Snapshot, 1.16.1

Loaders: Fabric

FileVersionLoaderSize
libgamerule-1.15.2-0.0.1.jar1.15.2Fabric24 КБDownload
libgamerule-0.0.2-1.15.2.jar1.15.2Fabric23 КБDownload
libgamerule-0.0.4-1.15.2.jar1.15.2Fabric27 КБDownload
libgamerule-20w07a-0.0.1.jar1.16-SnapshotFabric24 КБDownload
libgamerule-0.0.2-20w08a.jar1.16-SnapshotFabric23 КБDownload
libgamerule-0.0.4-20w08a.jar1.16-SnapshotFabric27 КБDownload
libgamerule-0.0.5-1.16.1.jar1.16.1Fabric28 КБDownload
libgamerule-0.0.5-1.16.1.jar1.16.1Fabric28 КБDownload
libgamerule-0.0.6-1.16.1.jar1.16.1Fabric28 КБDownload

LibGamerule

Minecraft's built-in gamerule system offers a handful of useful toggles, but what if you need more? That is where LibGamerule steps in. This lightweight library mod opens the door for mod developers and datapack creators to define their own gamerules, complete with flexible data types and seamless integration into the existing /gamerule command. Whether you are building a complex modpack or a standalone mod, LibGamerule provides the foundation you need to give players control over custom mechanics.

What is LibGamerule?

LibGamerule is a Fabric mod that acts as an API for adding custom gamerules. Instead of each mod reinventing the wheel, developers can depend on this library to register boolean, integer, double, string, and even enum-based rules. The mod then handles all the heavy lifting: syncing rules between server and client, persisting values, and exposing them through the standard /gamerule command. For players, this means a consistent and familiar way to tweak modded gameplay settings.

Key Features for Mod Creators

LibGamerule supports a wide range of rule types, making it versatile for almost any use case. Developers can register:

  • Boolean rules – simple on/off toggles.
  • Integer rules – whole numbers with optional min/max bounds.
  • Double rules – decimal numbers with optional min/max bounds.
  • Enum rules – any Java enum for multiple choice options.
  • String rules – greedy strings that capture the rest of the command input.

Registration is straightforward. For a boolean rule, a modder simply calls Gamerule.register("myGameRule", BooleanRule.create(true)) and then retrieves the value with Gamerule.get(MY_GAMERULE). The library is designed for Fabric and works across modern Minecraft versions, including 1.16, 1.17, 1.18, 1.19, and the latest 1.20 releases. It requires the Fabric API and is compatible with the Fabric loader.

LibGamerule for Datapack and Modpack Developers

Beyond modding, LibGamerule integrates with LibCD, a library that allows datapacks and modpacks to run scripts. This means you can create custom gamerules without writing a single line of Java. Using a simple JSON condition, you can check the value of a gamerule in a datapack predicate. For example, a condition like "libgamerule:gamerule_has_value": "my_custom_rule" can gate advancements, loot tables, or functions. You can even define new rules directly in a script using libcd.require("libgamerule.GameruleTweaker") and then call addGamerule with a name, type, and default value. This makes LibGamerule an indispensable tool for modpack authors who want to give server admins fine-grained control without requiring them to install a full mod.

How to Install LibGamerule

Installing LibGamerule is as simple as any other Fabric mod. First, ensure you have the Fabric loader installed for your chosen Minecraft version. Then, download LibGamerule from a trusted mod repository. Place the .jar file into your mods folder, along with the Fabric API if it is not already present. Launch the game, and the library will be active. If you are using a custom launcher like the foxygame.net launcher, you can find LibGamerule in its integrated add-on catalog and install it with a single click, with the launcher automatically handling version compatibility and updates. For manual installation, always double-check that you have the correct version of LibGamerule for your Minecraft release.

Why Choose LibGamerule for Minecraft?

There are several reasons why LibGamerule has become a go-to library for Fabric modding. First, it eliminates repetitive boilerplate code. Second, it ensures that all custom gamerules behave consistently, which is crucial for player experience. Third, its LibCD support bridges the gap between mods and datapacks, empowering a broader range of creators. Finally, the mod is actively maintained and lightweight, so it adds no noticeable overhead to your game. Whether you are a mod developer looking to streamline your code or a modpack maker wanting to add server-side configuration options, a download LibGamerule is the first step toward a more customizable Minecraft world.

Getting Started with Custom Gamerules

Once LibGamerule is installed, you can immediately start using it in your own mods or scripts. For mod developers, add the library as a dependency in your fabric.mod.json and begin registering rules in your mod's initialization code. For datapack creators, ensure LibCD is also present, then use the provided tweaker functions to define and query rules. The library's documentation offers clear examples, and the community around LibGamerule for Minecraft is growing, with many modpacks already relying on it to deliver unique gameplay experiences.

In conclusion, LibGamerule fills a critical gap in the Minecraft modding ecosystem. It transforms the rigid gamerule system into a flexible, extensible framework that anyone can harness. By providing a unified API and supporting both code and script-based workflows, it empowers creators to build richer, more configurable worlds. If you have ever wished for a custom gamerule, now is the time to explore what LibGamerule can do for your next project.