Moonlight 9minecraft Lib (26.2) - Draai complexe mods
The Best Resource for Minecraft
The Best Resource for Minecraft

Moonlight Wiki

A guide to Moonlight, a multi-loader library and utility framework for Minecraft mods. Covers what the library provides (dynamic assets, map markers, soft fluids, data-driven trades), which mods need it, and its developer role.

4 sections · 527 words

Overview#

Moonlight is a general-purpose library and utility framework for Minecraft mods. It bundles a broad set of systems that mod authors reuse instead of writing from scratch: dynamic client-side asset generation (textures, models, and language files created while you play), data-driven villager trades and dynamic villager schedules, a Map Marker API for adding custom markers and decorations to in-game maps, a Soft Fluid system for handling fluids inside tanks and containers, and a large collection of multi-loader utility, registry, networking, and platform-abstraction helpers so a single mod codebase can run across different loaders.

Moonlight has no player-facing content of its own - it adds no blocks, items, mobs, or gameplay. On its own it does nothing visible in-game; it exists purely so that other mods can build on top of it. You only ever install it because another mod lists it as a required dependency. Its mod id is moonlight.

Which Mods Need It#

Install Moonlight whenever a mod you use lists it as a dependency (mod id moonlight). If it is missing, those mods will fail to load and the game will report a missing-dependency error for moonlight.

  • Moonlight is the core library behind the Supplementaries family of mods - so those mods need it in your mods folder.
  • Any other mod that uses Moonlight's dynamic assets, map markers, soft fluids, or data-driven trades also requires it.

Because it is a shared dependency, the rule of thumb is simple: add Moonlight when a mod tells you to, and leave it out otherwise.

Developer API#

Moonlight is consumed by other mods as a dependency (mod id moonlight).

Adding it to a dev environment (Gradle): declare a modImplementation dependency on the Moonlight artifact that matches your Minecraft version and loader, and reference the mod id moonlight in your mod metadata so the game enforces load order.

Key areas the library exposes:

  • Dynamic resources - generate textures, models, and language entries at runtime instead of shipping every asset (useful for mods with many procedurally-styled variants).
  • Map Marker API - register custom markers and decorations that render on in-game maps.
  • Soft Fluid API - a lightweight fluid abstraction for storing and displaying fluids in tanks and containers.
  • Data-driven villager trades & schedules - define trades and villager daily schedules through data.
  • Platform / registry / networking helpers - multi-loader abstractions so common code runs across loaders.

Consult the in-code documentation for full API details and current version coordinates.

FAQ & Troubleshooting#

What does Moonlight do on its own? Nothing visible - it is a library. It only matters when another mod depends on it.

A mod says it needs "moonlight" - what do I do? Add Moonlight to your mods folder alongside that mod, then launch again.

I get a missing-dependency error for moonlight. That means a mod needs Moonlight but it is not installed (or the version is too old). Install a matching Moonlight build so the mod can load.

Do I need Moonlight if no mod asks for it? No. It has no content, so there is no reason to install it unless a mod requires it.

Is it safe to remove? Only if no installed mod still depends on it; otherwise those mods will stop loading.