MagicLib
by hendrix-shen
Developers who need dependency checks beyond what Fabric Loader offers can use MagicLib, a library that tests dependency expressions and custom predicates.
What it does
MagicLib provides a dependency checking system. A dependency can be verified with an expression or a custom predicate, and the check decides whether a feature loads. The library is built for mod developers, so it is used inside other mods rather than played directly.
The checks apply in three places: a Mixin plugin that adds dependency checks Fabric Loader lacks, Mixin application that only goes ahead when conditions hold, and configuration management that shows an option only when its conditions are met. Every player and the server need a copy of the mod. Builds exist for Fabric, Forge, NeoForge and Quilt across 34 release versions, 1.14.4 – 26.3, and the code is open source under the GNU Lesser General Public License v3.0 only.
Key features
Expression-based dependency checks
Dependencies can be tested with expressions, so a feature depends on the presence and version of other mods.
Custom predicates
Developers can write their own predicate functions when an expression cannot describe a condition.
Conditional Mixins
A Mixin is applied only when its dependency conditions are satisfied, which keeps patches inactive when a required mod is absent.
Conditional configuration options
A configuration item is displayed only when its conditions are met, so players see options that apply to their setup.
Ported MaLiLib features
Some features from a newer MaLiLib build are carried back, so the same code works on older Minecraft versions.
Compatibility
Latest build for each game version and loader.
26.x5 of 5 versions with builds
1.21.x12 of 12 versions with builds
1.20.x7 of 7 versions with builds
1.19.x5 of 5 versions with builds
1.18.x1 of 1 version with builds
1.17.x1 of 1 version with builds
1.16.x1 of 1 version with builds
1.15.x1 of 1 version with builds
1.14.x1 of 1 version with builds
This mod also publishes snapshot builds. Snapshots are not shown in the matrix.
Requirements
Dependencies declared by the latest file for each loader.
Required by 6 mods
Use cases
Gating code by side
A mod can check dependencies separately for its code on the client and on the server, filling gaps in Fabric Loader's own checks.
Who it’s for: Mod developers who maintain code across several Minecraft versions or loaders and need conditional loading that the loader itself does not provide.
Questions
Does MagicLib need other mods to run?
Which loaders does MagicLib support?
Which mods use MagicLib?
In the catalog
MagicLib is one of 3,514 Library mods on ModsFinder, and one of 2,348 Library mods for Fabric. 8,071 mods support Minecraft 26.3.
More from hendrix-shen
Similar mods
What the author says
❗Before reporting a problem, be sure to try the latest beta version to check if the problem still exists. A library of versatile mod dependencies.
Official listing
- Modrinth page
- modrinth.com/mod/magiclib
- Owner
- hendrix-shen
- Published
- 2022-04-16
- Updated on Modrinth
- 2026-09-27
- Facts verified
- 2026-10-15
