Phantom Loader
by HexagonNico
Developers who ship one codebase for Fabric and Forge can use Phantom Loader to generate the loader-specific initializer classes at build time.
What it does
Building a mod for several loaders usually means maintaining a separate module for each, filled with setup code that does nearly the same job. This library produces the Forge and Fabric initializer classes during the build, so the bulk of the logic can stay in the common module.
The library also wraps each loader's basic functions behind an abstraction layer, so the developer's code depends only on the abstraction in the common module rather than on either loader directly. The project is open source under the Apache License 2.0, and its source code, issue tracker and wiki are public. Phantom Loader requires Fabric API and is used by at least one other catalog mod, Spider Caves. Its files cover five game versions, 1.19.4 – 1.20.4, for Fabric and Forge, and the client and server both run it.
Key features
Generated initializers
Forge and Fabric initializer classes are produced at build time from the common module.
Loader abstraction
Basic loader functions are wrapped so mod code can call one interface on either loader.
Shared common module
Most mod code lives in one common module, with loader-specific parts reduced to generated stubs.
Public source and wiki
The source code, issue tracker and wiki are linked publicly for developers who want to read the implementation.
Compatibility
Latest build for each game version and loader.
Only full game releases are shown. This mod publishes no snapshot builds.
Requirements
Dependencies declared by the latest file for each loader.
Required 1
Required by 1 mod
Use cases
Dual-loader mod development
A developer targeting both Fabric and Forge keeps a single common codebase instead of two loader modules with duplicated setup code.
Who it’s for: Mod developers who publish one project for both Fabric and Forge. Players and server owners have no direct use for the library, although a mod built on it may ask for it as a dependency.
How it compares
RickCore is a library for Fabric, Forge and NeoForge, all rights reserved and closed to reuse, with files for 1.20.1 – 26.3. SebastrnLib targets Forge only, is open source under the MIT License and covers 1.18.2 – 1.20.1. Phantom Loader generates the initializers for Fabric and Forge, while those two libraries offer different scopes.
| Mod | Loaders | Game versions | Environment | Updated |
|---|---|---|---|---|
| Phantom Loader | Fabric and Forge | 1.19.4 – 1.20.4 | Client and server | 2024-01-21 |
| RickCore | Fabric, Forge and NeoForge | 1.20.1 – 26.3 | Client and server | 2026-09-24 |
| SebastrnLib | Forge | 1.18.2 – 1.20.1 | Client and server | 2023-08-15 |
Questions
Does Phantom Loader need Fabric API?
Is Phantom Loader needed on the server?
Which game versions are supported?
Which mod uses Phantom Loader?
In the catalog
Phantom Loader is one of 3,514 Library mods on ModsFinder, and one of 2,348 Library mods for Fabric. 13,907 mods support Minecraft 1.20.4.
More from HexagonNico
Similar mods
What the author says
Phantom Loader is a library that automates part of the process of creating Minecraft mods for multiple mod loaders by generating loader-specific code at build time. Normally, when creating a mod for both Fabric and Forge, mod developers have to create separate modules for both mod loaders and add loader-specific code…
Official listing
- Modrinth page
- modrinth.com/mod/phantom-loader
- Owner
- HexagonNico
- Published
- 2024-01-08
- Updated on Modrinth
- 2024-01-21
- Facts verified
- 2026-10-15
