Mod:Unruled Api

From Modded Wiki
Revision as of 23:55, 8 January 2025 by Nerjal Nosk (talk | contribs) (Created page with "{{Infobox mod|title=Unruled API|image=Unruled_api_icon.png|author=RecraftorsMC|developer=Nerjal Nosk|latest_release=0.6 (2025-01-03)|initial_release=0.1 (2024-01-24)|modloader={{Fabric}},{{NeoForge}}|minecraft_version=active:{{1.21}}, {{1.21}} <br> inactive: {{1.18}}, {{1.19}}|modrinth=https://modrinth.com/mod/unruled-api|sources=https://codeberg.org/RecraftorsMC/unruled-api}} '''Unruled API''' is a library mod, that allows other mod to easily creat...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Unruled API
Unruled_api_icon.png: Infobox image for Unruled API the mod in Minecraft
Author

RecraftorsMC

Latest Release

0.6 (2025-01-03)

Initial Release

0.1 (2024-01-24)

Mod Loaders

Fabric Fabric,NeoForge NeoForge

Minecraft Versions

active:Minecraft 1.21, Minecraft 1.21
inactive: Minecraft 1.18, Minecraft 1.19

Modrinth

https://modrinth.com/mod/unruled-api

Sources

https://codeberg.org/RecraftorsMC/unruled-api

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.