Preloading Tricks Mod lets you run advanced code during the earliest stage of the Minecraft mod loader. It gives you early hooks, SPI-based callbacks, and Java Instrumentation class transformation tools to extend how the loader starts up. You can change mod lists before discovery, edit classes that are already loaded in the JVM, and bundle LexForge and NeoForge files inside one JAR. This mod works on Fabric, LexForge, and NeoForge, and it relies on the loader version rather than the Minecraft version.

Features:

  • Early Loader Entrypoint: Gives you early access to the loader through PreloadingEntrypoint using SPI-based callbacks that run before regular mods start up.
  • Java Instrumentation ClassTransform: Lets you edit the bytecode of already-loaded classes in the JVM, including Java core classes and classloader classes.
  • Forge Variant Detection: Provides ForgeVariants on Forge-like loaders so your code can detect specific Forge or NeoForge versions at runtime.
  • Registers class transformers on all supported platforms by adding the ClassTransformConfig attribute to your MANIFEST.MF file.
  • Lets you bundle both LexForge and NeoForge JARs together via jar-in-jar in a single mod file, loading each part only on its matching loader.
  • Runs on Fabric, Forge (LexForge), and NeoForge based on the loader version instead of the Minecraft version.
  • Supports automatic platform selection through Gradle variant matching and Cloche, with optional classifiers for fabric, forge-service, neoforge-modlauncher, and neoforge-fancy-mod-loader.

Early Callback Events:

  • Runs SETUP_LANGUAGE_ADAPTER through PreloadingTricksCallbacks during the early language adapter setup stage.
  • Runs COLLECT_MOD_CANDIDATES so you can dynamically add mod candidate paths before mod discovery begins.
  • Runs SETUP_MODS so you can add, remove, or check mods in the mod list using the ModManager API.

How to Use:

  1. Add the Maven repository https://raw.githubusercontent.com/settingdust/maven/main/repository/ to your Gradle build file so Gradle can resolve the library.
  2. Add the base dependency implementation("settingdust.preloading_tricks:PreloadingTricks:VERSION") and replace VERSION with the latest release (for example, 3.5.9); Gradle variant matching or Cloche automatically selects the matching platform artifact based on your loader attributes.
  3. Optionally pin a platform classifier (fabric, forge-service, neoforge-modlauncher, or neoforge-fancy-mod-loader) if you want to avoid accidentally using APIs from other platforms.
  4. Use PreloadingEntrypoint and register callbacks on PreloadingTricksCallbacks (SETUP_LANGUAGE_ADAPTER, COLLECT_MOD_CANDIDATES, or SETUP_MODS) to run early loader logic before standard mod setup begins.
  5. To transform loaded classes, create a JSON config file listing your package and transformers, then register it in MANIFEST.MF with ClassTransformConfig so the transformers apply early in the JVM.
  6. When bundling LexForge and NeoForge JARs together via jar-in-jar, add ForgeVariant: LexForge or ForgeVariant: NeoForge to each MANIFEST.MF so only the matching variant loads at runtime.

Example Gradle setup (Kotlin DSL):

repositories {
    maven("https://raw.githubusercontent.com/settingdust/maven/main/repository/")
}

dependencies {
    implementation("settingdust.preloading_tricks:PreloadingTricks:VERSION")
}

Configuration:

  • ClassTransformConfig: Declares one or more class transformer JSON files inside MANIFEST.MF on all platforms. Point to one file with ClassTransformConfig: xxxx.classtransform.json, or list multiple files separated by commas such as ClassTransformConfig: first.classtransform.json,second.classtransform.json.
  • ForgeVariant: Limits a mod JAR to a specific Forge-like loader inside MANIFEST.MF. Set it to ForgeVariant: LexForge or ForgeVariant: NeoForge so the mod only loads when running on the matching loader variant.

Example ClassTransform config file (xxxx.classtransform.json):

{
  "package": "settingdust.preloading_tricks.neoforge.transformer",
  "transformers": [
    "mod_setup_hook.FMLLoaderTransformer"
  ]
}

Screenshots:

Minecraft mod list menu displaying preloading tricks information
Preloading Tricks listed inside the active mods menu after early game initialization
Iron golem walking through a village in a grassland biome
Iron golem patrols village pathways in a world running early loader hooks
Minecraft village with savanna style houses and custom terrain
Savanna settlement generated cleanly across hills during a stable modded play session
Minecraft village center with iron golem and villagers near a bell
Villagers gather around the town bell alongside an iron golem guardian
Wooden flower box with flowers in Minecraft village
Decorative wooden flower box placed beside a cozy villager house exterior
Aerial view of a Minecraft village on a grassy hill
Overview of a sprawling hillside village running alongside active runtime transformers
A savanna landscape with trees and a winding river
Winding river cutting through a peaceful savanna biome loaded with custom mods

Preloading Tricks Mod Download Links

Filter by

For Minecraft 26.1.2, 26.1.1, 26.1

Forge, Fabric, NeoForge 2 MB

For Minecraft 1.20.1 –> 1.21.11

Forge, Fabric, NeoForge 1 MB

For Minecraft 1.21.11, 1.21.5, 1.21.4

Forge, Fabric, NeoForge 2 MB

For Minecraft 1.20.2, 1.20.1, 1.20

Forge, Fabric, Quilt 31 KB

For Minecraft 1.20.1, 1.20, 1.19.4

Forge, Fabric, Quilt 22 KB

Click to rate this post!
[Total: 0 Average: 0]
QUICK MINECRAFT SURVEY · ONE TAP
Mods & Modpacks

What is the longest real-time wait you will tolerate for a heavily modded game to load to the main menu?

2 responses · See the full results →