
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 runningnew ConditionalModInitializer.Builder())mods()-> List : Returns the list of any mod that is required for this initializerrequired_mods()-> List : Returns list of all required mods for this initializercan_run-> Boolean : Whether or not the initializer has ran yetenvironment()-> ExtendedEnvType : Returns the environment (initializer type) for this initializerExtendedEnvType.CLIENT: ClientModInitializerExtendedEnvType.SERVER: ModInitializerExtendedEnvType.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 runrequired_mods(String...): Appends to the list of required mods for this initializerenvironment(ExtendedEnvType): Sets the environment of the initializer (Default:ExtendedEnvType.SERVER: ModInitializer)found(Runnable): Code to execute if the mod is foundinitializer(Class<ModInitializer>): Initializer to run if the mod is foundmainInitializer(Class<ModInitializer>): Initializer to run if the mod is foundclientInitializer(Class<ClientModInitializer>): Initializer to run if the mod is foundserverInitializer(Class<DedicatedServerModInitializer>): Initializer to run if the mod is foundbuild(): Returns the finalized ConditionalModInitializer
- Edition: Minecraft Java
- File type: .jar
- Minecraft versions listed: 1.14, 1.14.1, 1.14.2
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Modrinth — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
- Ships as mod-proxy-initializers-1.0.jar — drop this file into the mods folder
- Download size: 25 KB
- Download link checked 5 Sept 2026 — working
These come from our own check of the pack file, not from the source page.