Mod:Unruled Api
Author |
RecraftorsMC |
---|---|
Latest Release |
0.6 (2025-01-03) |
Initial Release |
0.1 (2024-01-24) |
Mod Loaders | |
Minecraft Versions | |
Modrinth | |
Sources |
{ "title": "Unruled API", "rows": [ { "field": "RecraftorsMC", "label": "Author" }, { "field": "0.6 (2025-01-03)", "label": "Latest Release" }, { "field": "0.1 (2024-01-24)", "label": "Initial Release" }, { "field": "(link to File:Fabric Logo.png article, displayed as 16px|alt=Fabric) [https://fabricmc.net/ Fabric],(link to File:NeoForge Logo.png article, displayed as 16px|alt=NeoForge) [https://neoforged.net/ NeoForge]", "label": "Mod Loaders" }, { "field": "active:(link to File:Minecraft icon.png article, displayed as 16px|alt=Minecraft) [https://minecraft.wiki/w/1.21 1.21], (link to File:Minecraft icon.png article, displayed as 16px|alt=Minecraft) [https://minecraft.wiki/w/1.21 1.21] <br> inactive: (link to File:Minecraft icon.png article, displayed as 16px|alt=Minecraft) [https://minecraft.wiki/w/1.18 1.18], (link to File:Minecraft icon.png article, displayed as 16px|alt=Minecraft) [https://minecraft.wiki/w/1.19 1.19]", "label": "Minecraft Versions" }, { "field": "https://modrinth.com/mod/unruled-api", "label": "Modrinth" }, { "field": "https://codeberg.org/RecraftorsMC/unruled-api", "label": "Sources" } ], "invimages": [], "images": [ "Unruled_api_icon.png" ] }
Unruled API is a library mod, that allows other mod to easily create new gamerules, using new kind of gamerules, new tools to tweak them, and provide more control over the game without the need for brand new functionalities like complex configuration files.
Additionally, despite some client-side integration for better ease of use, Unruled API works perfectly being only on the server, making it a proper server-side mod.
New Gamerule Types
Unruled API provides other mods with up to 9 new gamerule types:
Since 0.1:
- Floating gamerules
- Stores a float value, with precision ranging from 2-126 to 2127
- Long gamerules
- Stores a long value, ranging from -263 to 263-1
- Double gamerules
- Stores a double value, with precision ranging from 2-1022 to 21023
- String gamerules
- Stores a short textual value, with a hard maximum length of 128 characters.
- Text gamerules
- Stores a textual value, with an arbitrary maximum length to be determined by the mod creating the gamerule.
- Enum gamerules
- Stores an enum value, from a specified enum class. Values are parsed and recognized by name, and only those are suggested to the player upon trying to modify the gamerule's value from the chat.
Since 0.6
- Registry Entry gamerules
- Stores a Registry entry value as a Resource Location, and matches it with the appropriate registry value for the mod creating the gamerule to use.
All gamerule types have integration with the World Creation's Gamerules menu. However, due to menu development not being the strong suit of the developer, text rules' integration is marked as Not Yet Implemented, in view of a future easier mean to edit long to very long textual fields in a single menu.
Additional Functionalities
Unruled API allows mods to add to any new gamerule both a validator and an adapter. Those are meant to help a mod control what values can a gamerule accept.
The validator is used when providing a new value to the gamerule. It will test if the provided value matches custom conditions. If the value is accepted, then the gamerule value can properly change without any issue.
If the value is rejected by the validator, then the adapter will take it, and possibly try to provide a better fitting value. This new value will then be tested again with the validator for a final consistency check. Then only, if accepted, will the gamerule's value change.