Skip to content

About

a modloader which load resource pack as mod.

Resources

Stars

4 stars

Watchers

2 watching

Forks

Repository files navigation

ResourceModLoader Resource Mod Loader

Discord TotalAccess

Official repository for ResourceModLoader: source, local libraries, and examples.

What is ResourceModLoader

ResourceModLoader is a loader for non-executable resource mods, and a library for Java mods.

Minecraft Java Edition 1.13 added data packs. Before that, resource packs already had a few data-pack features: JSON recipes from More Recipes, JSON advancements from mods, and similar. Those features only worked inside mods. They did not work in a real resource pack.

RML packages a zip, jar, or directory that contains rml.info as a Forge mod and runs those data files. After CraftTweaker and KubeJS support, many people also use it to ship scripts. That is no longer a pure low-code data pack.

What can I do with ResourceModLoader?

See the documentation.

Where can I install it?

Use ResourceModLoader as a library

  1. Add CurseMaven.
  2. Pick a Maven short coordinate from the list.

This commit is an example of depending on RML and adding a module type.

The documentation is short

Yes. Open an issue if you want a page expanded, or send a pull request.

Runtime architecture

The runtime/ Java 8 subproject contains the dependency-free lifecycle kernel and directory/ZIP source snapshots. The root project owns Forge containers, module consumers, and game integration; the kernel imports no Minecraft, Forge, Gson, or logging APIs. Runtime classes are bundled into the mod jar.

Startup providers live in rml.loader.module and receive ModuleLoader through their constructors. LoaderRuntime is the composition root; Forge events and ASM hooks route into it. Providers do not look up global loader services. The former RMLLoaders aggregate and filesystem scanner have been removed.

The core mod container registers its lifecycle listener with FML so Forge enables RML and delivers construction, initialization, and server lifecycle events to the runtime. It exposes its own directory or jar to Forge's resource manager so built-in carrier models and textures load.

Run its isolated contract checks with a Java 8-compatible Gradle environment:

./gradlew -p runtime check

The checks exercise dependency validation, failed activation rollback, generation ownership, repeated replacement/unload, registry rebinding, and directory/archive source parity. The managed function provider exposes /rml functions status, reload [modid], and unload <modid>; other integrations retain startup semantics.

The Java API has moved to instance services under ResourceModLoader.runtime(). See the migration reference and 2.0 plan.

Enhanced data-pack source

The standalone Java 8 compiler/ project compiles data-pack directories or ZIPs into installable RML content. It preserves namespaces and assets, resolves function and registry tags, lowers enhanced commands and rules, and keeps source locations in the artifact. Native Forge providers execute the compiled definitions.

./gradlew -p compiler check executableJar
java -jar compiler/build/libs/rml-compiler.jar capabilities
java -jar compiler/build/libs/rml-compiler.jar compile dev/datapack-example build/rml-agent-example.zip

The source catalog follows Minecraft's data-driven registries. The target game remains Forge 1.12.2; native definitions and version differences are validated by their providers. Functions, data rules, world generation, gameplay, presentation, clocks and world tests share the extensible decoder registry. Generic containers preserve their element types, including nested weighted values and typed constructor arguments.

See the source example, decoder API, and source and runtime guide. The example clock drives the overworld from time zero; use a preview world. /rml capabilities lists actual runtime providers, and /rml capabilities decoders lists registered decoder names.

Agent integrations can use /rml tools inspect, check [pack], apply <candidate> <revision>, and deactivate <session> <revision> <pack> [pack...]. Every response is JSON with diagnostics and the current state. Check prepares a detached candidate; apply commits that exact candidate with revision protection. See the runtime tool contract.

Server-hosted Agent and terminal

The agent/ Python 3.11+ package runs Google ADK 2.14.1 in a process owned by the Minecraft server. Install it with python -m pip install ./agent, build :compiler:executableJar, and configure config/rml-agent.json with the Python command, compiler JAR and model provider. Supply credentials through the configured environment variable before starting Minecraft. An unconfigured model is reported explicitly.

/rml agent start|status|stop manages the service. Start returns a private connection file for rml-agent tui --connection <file>; enabling automatic startup restores the console session and existing connections. The TUI displays actual model/tool events, file diffs and compiler output. Ctrl-C cancels a request; Ctrl-D detaches while the service continues running.

Each operator has an isolated, persistent workspace and conversation. Compiled builds enter the real runtime through checked candidates and revision protection. Native commands retain the player's identity and return their actual messages. Registry additions require installing the build for the next JVM launch. Durable request receipts prevent repeated game mutations after reconnects or service restarts.

run_scenario waits for an installed world test's assertions and cleanup, returning its native pass/fail/cancel result. Cancelling the Agent request cancels that scenario. Retained results can be queried or cancelled within the owning session; the game exposes the same behavior through /rml test run|status|cancel. Tests restore captured blocks, block entities and world time; use an appropriate test area because this is not an isolated preview world.

create_preview(build_id, seed) starts an owned build in a separate game JVM with a fresh save. Client hosts open an independent preview window; dedicated hosts expose a loopback preview server. inspect_preview, preview_command and run_preview_scenario operate on that instance. close_preview reaps its process and removes its disposable save while retaining the compiled build. The same build can later be checked and applied or installed in the host world through the existing explicit tools. See isolated previews for lifecycle and environment boundaries.

See Agent setup, sessions and verification for model configuration, SSH connections, artifact access and the distinction between live application and startup installation.

Documentation

The site is built with MkDocs Material; the configuration is mkdocs.yml and the sources are docs/.

python -m venv .venv-docs
.venv-docs/Scripts/python -m pip install -r requirements-docs.txt
.venv-docs/Scripts/python -m mkdocs serve
.venv-docs/Scripts/python -m mkdocs build --strict

mkdocs build --strict fails on broken internal links; the output is written to build/docs-site. CI builds and deploys it through .github/workflows/docs.yml, which requires the repository's Pages source to be set to GitHub Actions.

About

a modloader which load resource pack as mod.

Resources

Stars

4 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages