Features
- Cross-Version Support: Works across the entire range of Fabric-supported Minecraft versions
- Built-in JiJ: Leverages Fabric’s native Jar-in-Jar support
- First-Party Mixin: Uses Fabric’s built-in Mixin support
- Automatic Version Selection: Picks the latest version when multiple mods bundle the same dependency
- Fake Mod Support: Dynamically loaded mods appear as normal mods in ModMenu
Setup
Add Essential Loader as JiJ Mod
Include Essential Loader as a Jar-in-Jar dependency in your
fabric.mod.json:fabric.mod.json
Platform Details
Background
Fabric-loader works across the entire range of supported Minecraft versions. Unlike LaunchWrapper, fabric-loader was designed from the ground up as a mod loader with excellent support for:- Version selection (automatically picks latest)
- Jar-in-Jar mod bundling
- First-party Mixin support
- Comprehensive mod metadata
The only feature Fabric is missing for Essential Loader’s use case is the ability to chain-load mods or have custom code do mod discovery. Fabric always discovers all mods before running any third-party code.
Entrypoint
Essential Loader uses Fabric’s built-inpreLaunch entrypoint:
fabric.mod.json
Fake Mods
Essential Loader creates “fake mods” for dynamically loaded mods to make them appear as normal mods in the Fabric ecosystem.How It Works
Instantiate Mod Metadata
Essential Loader uses fabric-loader internals to instantiate mod metadata for dynamically loaded mods. This allows them to appear as normal mods in ModMenu and other mod lists.
Register with Fabric
The fake mod is registered with Fabric’s mod system, making it visible to:
- ModMenu
- Mod dependency systems
- Other mods querying for loaded mods
Fallback Strategy
Because fake mod creation makes heavy use of fabric-loader internals (which may break with updates), it’s kept optional. If it fails, the mod should not rely on Fabric entrypoints and should use alternative initialization methods (e.g., Essential uses a custom mixin for its init entrypoint).
Jar-in-Jar Handling
By the time Essential Loader runs, fabric-loader has already loaded all mods. Essential Loader must handle JiJ mods inside dynamically loaded mods itself.Version Handling
Essential Dependencies Generation
Detect Version Conflict
Essential Loader detects that an older version of a JiJ dependency is already loaded.
Generate Dependencies Mod
A new jar file is created in the
.minecraft/mods folder containing the newer version.This solution doesn’t rely on fabric-loader internals at all, making it very stable. However, it does mean the user may need to manually restart on each update of the JiJ mod.
Platform-Specific Considerations
Class Loading
Dynamically loaded mods are added to Fabric’s class loader during thepreLaunch phase. This ensures they’re available before main game initialization.
Stability
Best Practices
- Don’t Rely on Fabric Entrypoints: Dynamically loaded mods should use alternative initialization methods (e.g., mixins) rather than relying on Fabric’s entrypoint system.
- Test Version Conflicts: Test your mod with various versions of dependencies to ensure the JiJ handling works correctly.
- Graceful Degradation: Design your mod to work even if fake mod creation fails.
Complete Example
Here’s a complete example of integrating Essential Loader with a Fabric mod:fabric.mod.json
build.gradle.kts
Troubleshooting
Mod Not Showing in ModMenu
Workaround: Use custom initialization methods (e.g., mixins) instead of relying on Fabric entrypoints.Version Conflicts Requiring Restart
This is expected behavior when an older version of a JiJ dependency is already loaded. The user will be prompted to restart, and the newer version will load on next boot.Fabric Loader Updates Breaking Fake Mods
Fake mod creation uses fabric-loader internals and may break with updates. This is a known limitation. Essential Loader attempts to gracefully degrade when this happens.