Overview
SSECLib is an annotation-driven command and event framework for Fabric mods.
Instead of hand-building Brigadier trees and manually wiring Fabric event callbacks, you:
- expose one or more
ssecentrypoints infabric.mod.json - implement
SSECInitializer - point the library at the packages that contain annotated classes
- let the scanner register command and event handlers for you
Startup flow
Section titled “Startup flow”SuperSexyEventCommandLib is the Fabric ModInitializer for the library.
At startup it:
- loads every
ssecentrypoint viaFabricLoader.getEntrypoints("ssec", SSECInitializer.class) - calls
onInitializeSSEC()on each initializer - collects the packages returned by
getPackagesToScan() - runs
SSECScanner.initialize()after every package has been registered
This is the core contract of the framework: your mod tells SSEC where the annotated classes live, and SSEC handles discovery and registration.
Main public surface
Section titled “Main public surface”The public API is intentionally small:
SSECInitializerfor entrypoint setup@SSCommand,@SSCExecute,@SSCArgument,@SSCAlias, and@SSCPermissionfor commands@SSEventfor Fabric event listenersSSCArgumentAdapterfor custom argument mappingPermissionLevelandSSCPermissionCheckerfor permission policies
When to use it
Section titled “When to use it”SSEC fits best when your mod has:
- multiple commands or subcommands
- repeatable permission rules
- a lot of command argument parsing
- several Fabric callbacks that you want to keep close to feature code
If your mod has one tiny command and no reusable event layer, plain Brigadier and plain Fabric callbacks may still be simpler.