Overview
Modules are the core features in Sn0w. They extend theModule class and provide toggleable functionality with configurable settings.
Location: api/feature/module/Module.java
Module Class Hierarchy
Module Constructor
name- Display name of the modulecategory- Module category (see Categories section)
Basic Module Structure
Module Categories
Defined inapi/feature/Feature.java:416
Module Lifecycle
Initialization
Enable/Disable
super.onEnable() and super.onDisable() calls handle:
- Event bus registration/unregistration
- Chat notifications (if enabled)
- Module state tracking
Toggle
Module Values (Settings)
Creating Values
Using Values
Page-Based Values
Event Handling
Basic Event Listener
Multiple Events
Event Priorities
Real-World Examples
Example 1: FullBright Module
Location:impl/features/modules/render/FullBright.java
Example 2: Sprint Module
Location:impl/features/modules/movement/Sprint.java
Module Features
HUD Information
Display additional info next to the module name in HUD:Module Description
Display Name
Visibility
Chat Notifications
Keybinds
Modules implementIBindable through the Module class:
Singleton Pattern
For modules that need to be accessed from other classes:Minecraft Access
Modules implementIMinecraft interface:
Configuration (Save/Load)
Automatically handled by the Feature base class:- Module enabled state
- All registered values
- Keybind settings
Best Practices
Null Safety
Resource Cleanup
Value Dependencies
Performance
Module Registration
Modules are automatically registered when instantiated. They’re typically created in a module manager:Related Files
- Module base class:
api/feature/module/Module.java:21 - Feature base class:
api/feature/Feature.java:19 - Value builder:
api/value/builder/ValueBuilder.java - IMinecraft interface:
api/wrapper/IMinecraft.java - IBindable interface:
api/binds/IBindable.java