Alternations Lib
No reviews yet
This library is for mod developers to use items/blocks from other mods without errors.
Provides a framework or library for other mods to use.
Fabric is a mod loader for versions 1.14+ of Minecraft, particularly popular for client side and optimization mods.
Community voices
Reviews
Click once to include, again to exclude, again to clear
No reviews yet. Be the first to review this project!
Get it on
Available Platforms
Compatibility
Supported Environments
About
Project Details
For authors
Embed Badge
If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.
Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.
Identifiers
Platform IDs
Resources
External Links
About
Description
AlternationsLib — Advanced Dependency-Driven Entrypoint Loader for Fabric
AlternationsLib is a specialized initialization API for Fabric mod developers. It completely redefines how cross-mod integration works by introducing a multi-phase, dependency-aware loading sequence directly driven by mod metadata.
It allows you to safely use items, blocks, and mechanics from third-party mods without risking ClassNotFoundException or initialization crashes if those mods are absent.
⚙️ The Configuration Structure (fabric.mod.json)
To register your hooks, you declare them layout-style within the AlternationsLib block of your mod's metadata file:
{
"AlternationsLib": {
"entrypoint": "org.example.mod.integration.MyModHook",
"depends": [
"example_depend_id"
]
}
}
📘 Metadata Fields Breakdown:
AlternationsLib: The core configuration registry object scanned by this library at boot time.entrypoint: The fully qualified path to your Java class acting as the dedicated initializer for this specific integration.depends: An array of unique mod identifiers (ModID). This defines exactly which third-party mods must be resolved before this entrypoint is allowed to execute.
Java Implementation Example
Your integration class specified in the entrypoint field must implement the AlternationsRegistryInitializer interface and override the onInitialize() method.
Execution Pipeline: How It Actually Works
Unlike static loaders that initialize everything blindly, AlternationsLib parses all declared configuration blocks and orchestrates a dynamic, phased loading order:
1. The Scanning Phase
During the early launch stage, the library scans the fabric.mod.json files of every installed modification, indexing all registered AlternationsLib config blocks, their target entrypoints, and their dependency trees.
2. Phase 1: Zero-Dependency Initialization
The loader acts immediately after the standard Fabric environment settles. It first filters out and executes all entrypoints that have no dependencies declared in their "depends" array. These run as baseline initializers.
3. Standard Game Boot (ModInitializer)
The regular vanilla and mod loading cycles occur. Fabric handles standard mod setups, setting up mod registries, underlying game systems, and native ModInitializer blocks.
4. Phase 2: Dependency-Resolved Execution
Once the core environment is fully active, AlternationsLib re-evaluates the remaining indexed entrypoints:
- Dynamic Resolution: It checks the environment for the requested
"depends"IDs (e.g.,"example_depend_id"). - Safe Conditional Loading: If a dependency mod is active, its corresponding
entrypointclass is safely loaded into the JVM, casting it toAlternationsRegistryInitializerto triggeronInitialize(). This allows it to seamlessly hook into the resolved mod's blocks and items.
⚠️ IMPORTANT NOTE ON COMPATIBILITY REQUIREMENTS
🔴 Crucial Requirement: For this multi-phase dependency system to work correctly and guarantee that a dependent mod executes AFTER its target dependency, both mods must utilize AlternationsLib.
The target dependency mod (the one you are depending on) must also be registered via this library's system. If the target mod uses standard initialization methods instead of hanging on this library, the execution order cannot be guaranteed by Phase 2 mechanics. Make sure all participating mods hook into the
AlternationsLibecosystem!
Screenshots
Gallery
Versions
Files
Relations
Project Relations
More like this
Similar Mods
Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.
On ModDex
Community snapshot
By the numbers
Statistics
Want to reach Minecraft players?
We're looking for a server hosting partner to feature here and other parts of the site. Interested? Send us a message!
Get in touchGet it on
Available Platforms
On ModDex
Community snapshot
By the numbers
Statistics
Resources