Alternations Lib

Quick rating

Alternations Lib

No reviews yet

This library is for mod developers to use items/blocks from other mods without errors.

API/Library
Mod Loaders
Fabric
Minecraft
26.2

Community voices

Reviews

Versions
Loading versions…
Match includes

Click once to include, again to exclude, again to clear

Rating Any
Any 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0
Min
Max
Play Status
Reviews
Time Played
hrs+
Verified developers only
Has developer response
List view
Grid view
Compact view
Sort by
Date
Rating
Helpful
Unhelpful
Edited
Sort ascending
Delete this review?

This removes your review from the project. You can write a new review after.

Review submitted for moderation

Your review has been sent to moderators, who will check that it meets our guidelines before it appears publicly.

No reviews yet. Be the first to review this project!

Get it on

Available Platforms

Compatibility

Supported Environments

Dev Environment
Client Optional
Server Required

About

Project Details

Type
Mod
License
All Rights Reserved
Latest Version
1.0
Authors

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.

Custom banner text
ModDex rating badge preview

Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.

Identifiers

Platform IDs

Modrinth ID

Resources

External Links

Source Issues Wiki Discord

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 entrypoint class is safely loaded into the JVM, casting it to AlternationsRegistryInitializer to trigger onInitialize(). 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 AlternationsLib ecosystem!

Screenshots

Gallery

This project has no gallery images yet.

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

0
Ratings
0
Followers
0
In stacks

By the numbers

Statistics

<1,000
Downloads
Last Updated
CurseForge
Created
Last synced
When ModDex last fetched this project from CurseForge or Modrinth. Every project is re-checked on a schedule, and any project that ships a new file is synced automatically within hours of the release.
New file updates sync automatically
How syncing works