Mod
LibGamerule
No reviews yet
A library mod to add gamerules
Fabric is a mod loader for versions 1.14+ of Minecraft, particularly popular for client side and optimization mods.
Community voices
Reviews
Click once to include, again to exclude, again to clear
No reviews yet. Be the first to review this project!
Get it on
Available Platforms
About
Project Details
For authors
Embed Badge
If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.
Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.
Identifiers
Platform IDs
About
Description
LibGamerule
Libgamerule allows for easily adding custom gamerules on the Fabric modloader.
Usage (for mod devs)
// Adding a boolean gamerule
GameRules.RuleKey<BooleanRule> MY_GAMERULE = Gamerule.register(
"myGameRule", // name in /gamerule
BooleanRule.create(true) // default to true
);
// Get the gamerule data
boolean value = Gamerule.get(MY_GAMERULE);
Supported Rule types:
- BooleanRule
- DoubleRule (+min/max)
- IntRule (+min/max)
- EnumRule (Any Enum)
- StringRule (greedy strings)
Libcd support (datapack/modpack devs)
Conditions (note: does not support enums)
{
"when": [
{
"comment": "Boolean gamerule check",
"libgamerule:gamerule_has_value": "my_gamerule"
},
{
"comment": "Typed gamerule check",
"libgamerule:gamerule_has_value": {
"name": "my_gamerule_typed",
"type": "int",
"value": 10
}
}
]
}
Creating gamerules in scripts
var GameruleTweaker = libcd.require("libgamerule.GameruleTweaker");
GameruleTweaker.addGamerule("my_gamerule", "boolean", false);
GameruleTweaker.addGamerule("my_gamerule_typed", "integer", 7);
Screenshots
Gallery
Versions
Files
Relations
Project Relations
More like this
Similar Mods
Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.
On ModDex
Community snapshot
By the numbers
Statistics
Want to reach Minecraft players?
We're looking for a server hosting partner to feature here and other parts of the site. Interested? Send us a message!
Get in touchGet it on
Available Platforms
On ModDex
Community snapshot
By the numbers