Repository navigation
Mod Loading Process
Trin Wasinger edited this page Oct 21, 2026
·
6 revisions
Warning
While functional, the specifics of this feature are still being finalized and may change some.
Specter recursively searches the <mods> folder to discover files (depth-first, lexicographically).
- Folders and files starting with a
.or ending with*.disabledare skipped. -
*.zipfiles directly in<mods>(but not subdirectories) are searched as if they were folders. -
*.jarfiles are added to the classpath.- Specter's currently running jar is skipped if present.
-
Class Transformers listed in the
Transformer-Classesattribute of the jar's manifest are loaded (space and/or comma separated). - The static method
run()is called on classes listed in theScript-Classesattribute of the jar's manifest (space and/or comma separated).
-
*.groovy,*.gvy,*.gy, and*.gshfiles are compiled as Groovy.- All annotated Class Transformers are loaded.
- If the top level class is a
groovy.lang.Script(either explicitly or by having top level statements), it is executed (initialize mods, access tweakers, and event listeners here).
- All other files (e.g.,
READMEs,LICENSEs, and assets) are ignored.
To improve subsequent start-up times, Specter caches compiled classes in <mods>/.cache. Cached files are automatically invalidated if the original file changes. Classes loaded from the cache appear as if they were still loaded from their original location (e.g., for CodeSource#location and Groovy's SourceURI).
- All
*.jarfiles are loaded in a first pass before any Groovy files so that scripts can use them. - As an alternative to including
*.jardependencies directly, Groovy'sGrabannotation can be used to load from maven repositories. - To force a specific load order, prepend
00_,01_,02_, etc... to entries.