Sable fires three events that let you hook into the physics tick lifecycle and level initialization. Each event is aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ryanhcode/sable/llms.txt
Use this file to discover all available pages before exploring further.
@FunctionalInterface, and all three are registered through SableEventPlatform.INSTANCE — a platform-abstracted singleton that routes to the correct Fabric or NeoForge implementation automatically. Register your listeners during mod initialization before any worlds load.
Multiple physics substeps run per server game tick based on Sable’s configured sub-step count. Both
SablePrePhysicsTickEvent and SablePostPhysicsTickEvent fire once per substep, not once per game tick. Any logic that must influence the physics world — such as applying forces — should be placed in these events rather than in a server tick event.SablePrePhysicsTickEvent
Fired by SubLevelPhysicsSystem immediately before each physics substep is executed. Use this event to apply forces, set velocities, or otherwise prepare state that the physics solver will consume during the upcoming substep.
Callback signature:
| Parameter | Type | Description |
|---|---|---|
physicsSystem | SubLevelPhysicsSystem | The physics system about to execute a substep |
timeStep | double | Duration of this substep in seconds |
SablePostPhysicsTickEvent
Fired by SubLevelPhysicsSystem immediately after each physics substep completes. Use this event to read back simulation results — such as updated positions or velocities — or to trigger game logic that depends on the resolved physics state.
Callback signature:
| Parameter | Type | Description |
|---|---|---|
physicsSystem | SubLevelPhysicsSystem | The physics system that just completed a substep |
timeStep | double | Duration of the completed substep in seconds |
SableSubLevelContainerReadyEvent
Fired once when Sable has finished initializing for a level and the SubLevelContainer for that level is ready to use. This is the appropriate time to look up or register sub-levels that should exist at world load, or to cache a reference to the container for later use.
Callback signature:
| Parameter | Type | Description |
|---|---|---|
level | Level | The level instance whose container is now ready |
container | SubLevelContainer | The initialized sub-level container for that level |
Full registration example
The following example registers all three events in a common mod initializer entry point. The same code works on both Fabric and NeoForge becauseSableEventPlatform.INSTANCE is resolved at runtime.
