Preloading Tricks Mod FAQ
10 questions players actually ask, answered.
What is this mod actually for?
Preloading Tricks Mod is designed for mod developers, not regular players. It lets you hook into the mod loader before mods officially initialize and transform Java classes at the bytecode level—much earlier than mixins can reach. If you're not writing a mod that needs to modify loader behavior or another mod's classes during startup, you don't need this mod.
How do I set up class transformers for my mod?
Add a `ClassTransformConfig` attribute to your mod's manifest pointing to a JSON file (e.g., `classtransform.json`). In that JSON, specify the package and list the transformer classes you want to register. See the guide 'Set Up Class Transformers for Your Mod' for the exact format and working examples.
What early hooks are available?
The mod provides hooks like `onSetupLanguageAdapter` and `onSetupMods` that fire before the mod loader officially initializes. These let you intercept and modify how adapters are set up or how the mod list is processed. Check 'Use Early Loader Hooks in Your Mod Code' for the full list and how to register them.
Can I modify another mod's classes with this?
Yes—that's one of the main uses. By registering class transformers, you can edit the bytecode of any class (including from other mods) as soon as it loads into the JVM. See 'Modify Another Mod's Classes at Load Time' for setup instructions and examples.
How is this different from Mixins?
Preloading Tricks uses Java Instrumentation to transform classes at the bytecode level *before* the mod loader officially starts, whereas Mixins work during normal mod initialization. This means Preloading Tricks can intervene in loader setup itself, which Mixins cannot do.
Do I need to do anything special to enable class transformations?
Yes—you must add the `ClassTransformConfig` attribute to your mod's manifest file and point it to a valid JSON configuration. Without this attribute, the transformations won't be registered or applied.
What goes in the classtransform.json file?
The JSON should contain a `package` field (the base package of your transformers) and a `transformers` array listing the fully qualified class names of each transformer you want to register. See the guide 'Set Up Class Transformers for Your Mod' for a complete example.
Can this mod break compatibility with other mods?
Potentially, yes—if you use class transformers incorrectly or target the wrong classes, you can cause conflicts or crashes. Always test thoroughly with other mods and document what you're transforming. This is an advanced tool and requires careful use.
Will using this mod affect game performance?
Class transformations happen once at startup, so the performance impact is minimal during gameplay. However, complex or poorly written transformers can slow down the mod loading process itself.
How do I debug if my transformers aren't working?
Check that your manifest attribute points to the correct JSON file, that the JSON is valid, and that your transformer class names are fully qualified. Enable debug logging for the mod loader to see if transformers are being registered. See 'Intervene in Mod Loader Setup Before Initialization' for troubleshooting tips.