Back to mods
Conditional Proxy Mod Initializers project artwork

Modrinth · Minecraft mod

Conditional Proxy Mod Initializers

A simple library for running a proxy Fabric initializer if a required mod exists

Choose a version Pick your version below, then grab the matching file.

Quick answer

Which Conditional Proxy Mod Initializers release matches 1.20.3 Fabric?

Updated 2 years ago
Best match for your filters 1.0
Game version 1.14, 1.14.1, 1.14.2
Loader Fabric

Conditional Proxy Mod Initializers 1.0 targets 1.14, 1.14.1, 1.14.2 with Fabric. Installation on the client is optional. Installation on the dedicated server is optional. No extra mods listed for this file.

Where it goes

Is Conditional Proxy Mod Initializers required on the client, server, or both?

Installation on the client is optional. Installation on the dedicated server is optional.

Client Optional
Dedicated server Optional
Loader for this release Fabric
Required install it here Optional supported, not mandatory Not supported do not install here Source doesn’t say do not assume

The source marks this as usable on both the client and server.

What else does Conditional Proxy Mod Initializers 1.0 need?

1.0 on 1.20.3 Fabric. Every mod below is checked against that same setup.

No extra mods listed for this file

This file does not list any required mods. Do not add a library just because a different file uses it.

This file does not list any required or optional mods.

Before you install it

Add Conditional Proxy Mod Initializers without breaking your instance.

Built for Conditional Proxy Mod Initializers 1.0 on 1.20.3 Fabric. Pick another file and the loader, install side or required mods may change.

  1. 01

    Stick to this file

    Use 1.0. It targets 1.14, 1.14.1, 1.14.2 with Fabric; another release may have different loader, side or dependency requirements.

  2. 02

    Bring the mods it needs

    This file does not list any required mods. Do not add a library just because a different file uses it.

  3. 03

    Put it on the correct side

    Installation on the client is optional. Installation on the dedicated server is optional.

  4. 04

    Pick the file you checked

    Use the “Get this file” button beside 1.0. It opens that exact file at the source.

About this project

What does Conditional Proxy Mod Initializers add?

A simple 5-class mod which adds support for initializing code depending on if a specific mod exists.

This mod will always load last, so there is no need to worry about race conditions due to mod load order.

Code and variables must be available before or during any mod initialization stages
(ie cannot be done on datapack reload for example)

Usage:


// Inside main ModInitializer, ClientModInitializer, or any class that gets called at some point during Fabric init

// For running an instance of a ModInitializer:
ConditionalModInitializer myConditionalModInitializer = new ConditionalModInitializer.Builder().mods("some-mod").initializer(SomeOtherInitializer.class).build();

// For running any unspecified code:

ConditionalModInitializer myConditionalRunner = new ConditionalModInitializer.Builder().mods("some-other-mod").found(() -> {
  // Code goes here
}).build();
    public void onInitialize() {
ConditionalModInitializer.create().mods("some_mod").required_mods("some_other_dependency_mod").initializer(AnotherInitializer.class).build();
}
  • NOTE: new ConditionalModInitializer.Builder() MUST be assigned to a variable, or be called inside a function to work! Static declaration ( static{} will NOT work!)

Docs:

  • ConditionalModInitializer

    • create() -> Returns a new Builder() instance. (Same as running new ConditionalModInitializer.Builder())
    • mods() -> List : Returns the list of any mod that is required for this initializer
    • required_mods() -> List : Returns list of all required mods for this initializer
    • can_run -> Boolean : Whether or not the initializer has ran yet
    • environment() -> ExtendedEnvType : Returns the environment (initializer type) for this initializer
      • ExtendedEnvType.CLIENT : ClientModInitializer
      • ExtendedEnvType.SERVER : ModInitializer
      • ExtendedEnvType.DEDICATED_SERVER: DedicatedServerModInitializer
    • on_found() -> Runnable : Returns the function to call when a required mod is found
  • ConditionalModInitializer.Builder

    • mods(String...) : Appends to the list of mods that will allow this initializer to run

    • required_mods(String...) : Appends to the list of required mods for this initializer

    • environment(ExtendedEnvType) : Sets the environment of the initializer (Default: ExtendedEnvType.SERVER : ModInitializer)

    • found(Runnable) : Code to execute if the mod is found

    • initializer(Class<ModInitializer>) : Initializer to run if the mod is found

    • mainInitializer(Class<ModInitializer>) : Initializer to run if the mod is found

    • clientInitializer(Class<ClientModInitializer>) : Initializer to run if the mod is found

    • serverInitializer(Class<DedicatedServerModInitializer>) : Initializer to run if the mod is found

    • build() : Returns the finalized ConditionalModInitializer

Project description from Modrinth.

Pick your setup

Conditional Proxy Mod Initializers by Minecraft version and loader

Choose the version and loader you play, then open the matching release.

32 available setups

Showing the newest 12 of 32 game versions. Older files are in the list below.

Check the dependencies, then try the file in a copied instance before changing a world you care about.

Recent files

Conditional Proxy Mod Initializers versions and loaders

1 of 1 releases match

Looking for an older file? The official Modrinth project page is in Resources.