Overview
Preloading Tricks is a developer-only mod that enables advanced operations during the very early stage of the mod loader. It provides early hooks, Java Instrumentation-based class transformation, and SPI-driven callbacks for loader extension.
Supported environments:
- Fabric – 1.20.1, 1.21+
- Forge (LexForge) – 1.20.1
- NeoForge – 1.20.6, 1.21+
You can test on more versions since it depends on the loader version instead of the Minecraft version.
Features
-
Early loader entrypoint via
PreloadingEntrypoint(SPI-based)- Register callbacks using
PreloadingTricksCallbacksevents:SETUP_LANGUAGE_ADAPTER– early language adapter setup stageCOLLECT_MOD_CANDIDATES– dynamically add mod candidate paths before discoverySETUP_MODS– modify mod list (add/remove/query viaModManagerAPI)
- Register callbacks using
-
Instrumentation-powered
ClassTransformCan transform already-loaded classes, including Java core and classloader classes. Configure viaMANIFEST.MFon all platforms (see below). -
Forge variant detection (Forge-like only)
- Access
ForgeVariantsto detect specific Forge/NeoForge versions at runtime
- Access
Usage (Gradle)
Add the Maven repository and dependency to your build:
Kotlin DSL:
repositories {
maven("https://raw.githubusercontent.com/settingdust/maven/main/repository/")
}
dependencies {
// Recommended: use the base artifact (no classifier).
// Gradle variant matching / cloche will resolve the correct platform artifact automatically.
implementation("settingdust.preloading_tricks:PreloadingTricks:VERSION")
// Optional: pin to a specific classifier when you want to avoid accidentally using APIs
// from other platforms.
// implementation("settingdust.preloading_tricks:PreloadingTricks:VERSION:fabric")
// implementation("settingdust.preloading_tricks:PreloadingTricks:VERSION:forge-service")
// implementation("settingdust.preloading_tricks:PreloadingTricks:VERSION:neoforge-modlauncher")
// implementation("settingdust.preloading_tricks:PreloadingTricks:VERSION:neoforge-fancy-mod-loader")
}
Replace VERSION with the latest release (e.g. 3.5.9).
If you are using cloche, the corresponding variant is selected automatically based on loader/minecraft attributes.
ClassTransform Configuration
For all platforms, add the following attribute to your MANIFEST.MF:
ClassTransformConfig: xxxx.classtransform.json
Multiple configs can be specified as comma-separated values:
ClassTransformConfig: first.classtransform.json,second.classtransform.json
Example config (xxxx.classtransform.json):
{
"package": "settingdust.preloading_tricks.neoforge.transformer",
"transformers": [
"mod_setup_hook.FMLLoaderTransformer"
]
}
Forge Variant Detection (Forge-like only)
Allows a mod to load only on a specific Forge-like loader variant. This enables bundling both LexForge and NeoForge JARs together via jar-in-jar in a single mod file.
Configuration:
Specify your mod's target variant in MANIFEST.MF:
ForgeVariant: LexForge
or
ForgeVariant: NeoForge
Mods with a ForgeVariant specified will only load when running on the matching loader variant, allowing safe coexistence of variant-specific implementations.
For developers who need to reach into the earliest moments of Minecraft’s loading process.
All Versions
+ Add Version| Name | Game version | Platforms | Published | Downloads | Actions |
|---|---|---|---|---|---|
|
R
3.7.3
|
1d ago | 1 | |||
|
R
3.7.2
|
1d ago | 1 | |||
|
R
3.7.1
|
1d ago | 1 | |||
|
R
3.7.0
|
1d ago | 1 | |||
|
R
3.6.3
|
1d ago | 1 | |||
|
R
3.6.2
|
1d ago | 1 | |||
|
R
3.6.0
|
1d ago | 1 | |||
|
R
3.5.15
|
1d ago | 1 | |||
|
R
3.5.14
|
1d ago | 1 | |||
|
R
3.5.13
|
1d ago | 1 | |||
|
R
3.5.10
|
1d ago | 1 | |||
|
R
3.5.9
|
1d ago | 1 | |||
|
R
3.5.8
|
1d ago | 1 | |||
|
R
3.5.7
|
1d ago | 1 | |||
|
R
3.5.6
|
1d ago | 1 | |||
|
R
3.5.5
|
1d ago | 1 | |||
|
R
3.5.3
|
1d ago | 1 | |||
|
R
3.5.2
|
1d ago | 1 | |||
|
R
3.5.1
|
1d ago | 1 | |||
|
R
3.5.0
|
1d ago | 1 | |||
|
R
3.4.6
|
1d ago | 1 | |||
|
R
3.4.5
|
1d ago | 1 | |||
|
R
3.4.4
|
1d ago | 1 | |||
|
R
3.4.3
|
1d ago | 1 | |||
|
R
3.4.2
|
1d ago | 1 | |||
|
R
3.4.1
|
1d ago | 1 | |||
|
R
3.4.0
|
1d ago | 1 | |||
|
R
3.3.5
|
1d ago | 1 | |||
|
R
3.3.3
|
1d ago | 1 | |||
|
R
3.3.2
|
1d ago | 1 | |||
|
R
3.3.1
|
1d ago | 1 | |||
|
R
3.3.0
|
1d ago | 1 | |||
|
R
3.2.3
|
1d ago | 1 | |||
|
R
3.2.2
|
1d ago | 1 | |||
|
R
3.2.1
|
1d ago | 1 | |||
|
R
3.2.0
|
1d ago | 1 | |||
|
R
3.1.2
|
1d ago | 1 | |||
|
R
3.1.1
|
1d ago | 1 | |||
|
R
3.1.0
|
1d ago | 1 | |||
|
R
3.0.0
|
1d ago | 1 | |||
|
R
2.7.5
|
1d ago | 1 | |||
|
R
2.7.4
|
1d ago | 1 | |||
|
R
2.7.3
|
1d ago | 1 | |||
|
R
2.7.2
|
1d ago | 1 | |||
|
R
2.7.1
|
1d ago | 1 | |||
|
R
2.7.0
|
1d ago | 1 | |||
|
R
2.6.1
|
1d ago | 1 | |||
|
R
2.6.0
|
1d ago | 1 | |||
|
R
2.5.10
|
1d ago | 1 | |||
|
R
2.5.9
|
1d ago | 1 | |||
|
R
2.5.7
|
1d ago | 1 | |||
|
R
2.5.6
|
1d ago | 1 | |||
|
R
2.5.5
|
1d ago | 1 | |||
|
R
2.5.4
|
1d ago | 1 | |||
|
R
2.5.3
|
1d ago | 1 | |||
|
R
2.5.2
|
1d ago | 1 | |||
|
R
2.5.1
|
1d ago | 1 | |||
|
R
2.5.0
|
1d ago | 1 | |||
|
R
2.4.1
|
1d ago | 1 | |||
|
R
2.4.0
|
1d ago | 1 | |||
|
R
2.3.0
|
1d ago | 1 | |||
|
R
2.2.2
|
1d ago | 1 | |||
|
R
2.2.1
|
1d ago | 1 | |||
|
R
2.2.0
|
1d ago | 1 | |||
|
R
2.1.0
|
1d ago | 1 | |||
|
R
2.0.1
|
1d ago | 1 | |||
|
R
2.0.0
|
1d ago | 1 | |||
|
R
1.2.3
|
1d ago | 1 | |||
|
R
1.2.2
|
1d ago | 1 | |||
|
R
1.2.1
|
1d ago | 1 | |||
|
R
1.2.0
|
1d ago | 1 | |||
|
R
1.1.0
|
1d ago | 1 | |||
|
R
1.0.6
|
1d ago | 1 | |||
|
R
1.0.5
|
1d ago | 1 | |||
|
R
1.0.4
|
1d ago | 1 | |||
|
R
1.0.3
|
1d ago | 1 | |||
|
R
1.0.2
|
1d ago | 1 | |||
|
R
1.0.1
|
1d ago | 1 | |||
|
R
1.0.0
|
1d ago | 1 | |||
|
R
0.0.14
|
1d ago | 1 | |||
|
R
0.0.13
|
1d ago | 1 | |||
|
R
0.0.12
|
1d ago | 1 | |||
|
R
0.0.11
|
1d ago | 1 | |||
|
R
0.0.10
|
1d ago | 1 | |||
|
R
0.0.5
|
1d ago | 1 | |||
|
R
0.0.4
|
1d ago | 1 | |||
|
R
0.0.3
|
1d ago | 1 | |||
|
R
0.0.1
|
1d ago | 1 |
- [
9285f5d](https://github.com/SettingDust/preloading-tricks/commit/9285f5db5cff0f5e958e123a364eea77d32470f4) - transformer error *(commit by @SettingDust)*
- [
7c3f059](https://github.com/SettingDust/preloading-tricks/commit/7c3f05906a032cee83bff08c5c9978b3616b9b8b) - **build**: correct embed configuration attributes and resource inclusion for jar tasks *(commit by @SettingDust)*
### :recycle: Refactors
- [
3d8e46a](https://github.com/SettingDust/preloading-tricks/commit/3d8e46a3e11097341fb885cbc18835749b3fe116) - **build**: reconcile copier topology *(commit by @SettingDust)*
- [
6bc4e54](https://github.com/SettingDust/preloading-tricks/commit/6bc4e54d8bdf25b2b60ede84312439eeefc15879) - add NeoForgeAdapter to use right java version on older NF *(commit by @SettingDust)*
- [
155757b](https://github.com/SettingDust/preloading-tricks/commit/155757b45540625866043148cedda3e96ad5f90f) - wrong resolver transformer 2 *(commit by @SettingDust)*
- [
dd19a79](https://github.com/SettingDust/preloading-tricks/commit/dd19a79944a2110d8f39a26b6668b97fec2df997) - wrong resolver transformer *(commit by @SettingDust)*
- [
80ece07](https://github.com/SettingDust/preloading-tricks/commit/80ece0783e5514de4239baacb8c6b42311a113b4) - restore module injector api files *(commit by @SettingDust)*
### :recycle: Refactors
- [
089c55e](https://github.com/SettingDust/preloading-tricks/commit/089c55e6f54e9855d87bdda6be9fcd9d8c8dd4da) - restore build topology after copier update *(commit by @SettingDust)* - [
03196c6](https://github.com/SettingDust/preloading-tricks/commit/03196c6fe0b5dc3e29378e64acbf1f8fc9fde5f5) - obsolete NeoForge callback artifacts *(commit by @SettingDust)* - [
9f25b22](https://github.com/SettingDust/preloading-tricks/commit/9f25b2229375b4a35f75df1884ef84eb7ec74aef) - share list-backed mod manager logic *(commit by @SettingDust)* - [
4c719ff](https://github.com/SettingDust/preloading-tricks/commit/4c719ff9b17791fdc11014153f950f7ac9ebe7bd) - restructure sources into api core shared platform targets *(commit by @SettingDust)* - [
058d9ef](https://github.com/SettingDust/preloading-tricks/commit/058d9ef06864573f9cce46c35fb6ff9c07a6d642) - extract shared target/version constants in build script *(commit by @SettingDust)* - [
caaf03e](https://github.com/SettingDust/preloading-tricks/commit/caaf03ea82be09de76d084fac9f6230b7c9823cd) - deduplicate neoforge dependency excludes and rename run regions *(commit by @SettingDust)* - [
eec2d95](https://github.com/SettingDust/preloading-tricks/commit/eec2d9502958ef5ab2e09c686c91da0514532710) - extract run target MOD_CLASSES env setup *(commit by @SettingDust)* - [
5a8bc34](https://github.com/SettingDust/preloading-tricks/commit/5a8bc34f1b56a14e849417b5190a6a857710cf34) - align forge modlauncher package naming *(commit by @SettingDust)* - [
ae282c0](https://github.com/SettingDust/preloading-tricks/commit/ae282c0d536d32d608c14a782819f14b0043c457) - remove unused entrypoint and module injector leftovers *(commit by @SettingDust)*
### :wrench: Chores
- [
ee23367](https://github.com/SettingDust/preloading-tricks/commit/ee23367c06c817d390089b7c8ad674fe040c8f42) - copier update checkpoint B *(commit by @SettingDust)* - [
5a333b4](https://github.com/SettingDust/preloading-tricks/commit/5a333b401a4f904cd266b40048a39d884f128d89) - **plans**: add copier update execution artifacts and reconciliation gates *(commit by @SettingDust)* - [
83bd560](https://github.com/SettingDust/preloading-tricks/commit/83bd56075c5dee3252863fa4beca8aab4b145dbe) - remove obsolete copier gate and NeoForge 21.10 setup *(commit by @SettingDust)* - [
6757863](https://github.com/SettingDust/preloading-tricks/commit/675786300d4324b35128561b7b35aef071fef642) - remove plans *(commit by @SettingDust)* - [
0a66459](https://github.com/SettingDust/preloading-tricks/commit/0a66459345b486d10ea5dbbeefe4fbc288dc78b4) - remove unused files *(commit by @SettingDust)*
- [
af9ee68](https://github.com/SettingDust/preloading-tricks/commit/af9ee68c1ef83621abf771a92a1281e3f87426ba) - build output duplicated classes *(commit by @SettingDust)*
- [
60cc575](https://github.com/SettingDust/preloading-tricks/commit/60cc57538057e2f625702d022155a69a5900a8c9) - resolver transformer passing wrong arg *(commit by @SettingDust)*
- [
9bcfc60](https://github.com/SettingDust/preloading-tricks/commit/9bcfc60111fe943bf4cd461bf7eb57e1b4dbdc14) - **fabric**: dump duplicate jar info *(commit by @SettingDust)*
- [
2091c14](https://github.com/SettingDust/preloading-tricks/commit/2091c14f8716a1f5ebfb20cf138b88ba882cc94b) - avoid exit directly when failing to transform *(commit by @SettingDust)*
- [
94d0850](https://github.com/SettingDust/preloading-tricks/commit/94d0850e155820b2dfa107e4d6a6a8f1dd4c584b) - try to fix failing to transform resolver & bump class transform *(commit by @SettingDust)*
- [
b3e9059](https://github.com/SettingDust/preloading-tricks/commit/b3e9059f0e9a8c42e3de697edc6c5d726ce2a43f) - **neoforge/modlauncher**: additionalDependencySources isn't working *(commit by @SettingDust)*
- [
07d49a8](https://github.com/SettingDust/preloading-tricks/commit/07d49a8b5b9999f7a0209fc54bcc4dd5ff5887ea) - find the module from layer first *(commit by @SettingDust)*
- [
8fc2bea](https://github.com/SettingDust/preloading-tricks/commit/8fc2bea0902de1a5ba7b3c502af158dd70a6a087) - concurrent modification exception when modifying graph *(commit by @SettingDust)*
- [
c6f51b0](https://github.com/SettingDust/preloading-tricks/commit/c6f51b075578bbf5d338eb93098543f2b81222eb) - **forgelike**: full url for mod file string *(commit by @SettingDust)*
### :bug: Bug Fixes
- [
481183b](https://github.com/SettingDust/preloading-tricks/commit/481183bd8a9336282ae5843a0c06759c0eb537f0) - failing to add forgelike transformers *(commit by @SettingDust)*
- [
28bef8c](https://github.com/SettingDust/preloading-tricks/commit/28bef8cde733be224e9a7d064d96bdcb55c39ae6) - **forgelike**: avoid loading mods with default type *(commit by @SettingDust)*
- [
a830830](https://github.com/SettingDust/preloading-tricks/commit/a8308302ea89372b2d95176e86cfbcfef50a7014) - **forgelike**: log relate modules when resolve configuration failed *(commit by @SettingDust)*
- [
6baae48](https://github.com/SettingDust/preloading-tricks/commit/6baae4861cf69f6ce37db8da273f53c8f362c864) - allow load entrypoints on boot layer *(commit by @SettingDust)* - [
2edd2ad](https://github.com/SettingDust/preloading-tricks/commit/2edd2adad54c5ced0610b3d0b51ce83dc4b49839) - **fabric**: find the class transform from nest *(commit by @SettingDust)*
- [
128c7b9](https://github.com/SettingDust/preloading-tricks/commit/128c7b9f8e848dde2d8b7982e3c3173dcc829105) - class transform isn't working for loaded classes without manually retransform *(commit by @SettingDust)*
- [
b9f97e3](https://github.com/SettingDust/preloading-tricks/commit/b9f97e33d95f002dda5e07ff3913ec87ce7510dc) - **fabric**: stuck when start up *(commit by @SettingDust)*
- [
568203e](https://github.com/SettingDust/preloading-tricks/commit/568203e875ae1c4da5bef60b78a0ee8c99e363d2) - **fabric**: support ClassTransformConfig *(commit by @SettingDust)*
- [
f5d9725](https://github.com/SettingDust/preloading-tricks/commit/f5d9725d8bb384c2bd74a972fd9764db955231ab) - add MixinsTranslator for class transform for fabric *(commit by @SettingDust)*
- [
f37d8ee](https://github.com/SettingDust/preloading-tricks/commit/f37d8ee46f97668a681ccf511c4160a65ecd999b) - **forgelike**: add MixinsTranslator for class transform *(commit by @SettingDust)*
- [
9bca6ba](https://github.com/SettingDust/preloading-tricks/commit/9bca6ba0b5f8a7e68c2b79a733397c384715317a) - add sources jar to publishing *(commit by @SettingDust)*
- [
e63f68c](https://github.com/SettingDust/preloading-tricks/commit/e63f68c55948c405a713a9853e7a5954d9b03f56) - **fabric**: avoid crash when removing mods *(commit by @SettingDust)*
- [
d9bfd08](https://github.com/SettingDust/preloading-tricks/commit/d9bfd0815ed09b3cc64992c3ce0034eff17db207) - **neoforge/modlauncher**: wrong class name of invoker *(commit by @SettingDust)* - [
45a1852](https://github.com/SettingDust/preloading-tricks/commit/45a185209aecef0fa65ae728f9c4cc3e88d7c541) - **neoforge/fancy_mod_loader**: load the classes in correct class loader *(commit by @SettingDust)*
- [
e9292ae](https://github.com/SettingDust/preloading-tricks/commit/e9292aec0a8d8100dd0bbce1f492e44f1c1788e6) - the dependency source api actually work *(commit by @SettingDust)*
- [
3143812](https://github.com/SettingDust/preloading-tricks/commit/3143812e9d91df1ad838cdf87727283fdd1fcd6c) - show the error when failing to loading service *(commit by @SettingDust)*
- [
be2381f](https://github.com/SettingDust/preloading-tricks/commit/be2381f5a629f03dc331995fcbffaa6e2b5689d7) - load entrypoints on correct class loader *(commit by @SettingDust)*