SchedulingTestAdapter provides world-thread execution, while SchedulingAssert offers a targeted check for world liveness.
Scheduling tests are important for mods that dispatch asynchronous work onto the world thread. If the world is not alive or the scheduling mechanism is broken, those dispatched tasks silently fail. These tests verify that the scheduling infrastructure works correctly.
Complete Example Suite
Adapter Methods
| Method | Returns | Description |
|---|---|---|
executeOnWorldThread(Object world, Runnable task) | boolean | Dispatch a task onto the world’s execution thread |
schedulingAvailable() | boolean | Check if the World class exposes an execute() method |
Assertion Methods
| Method | Failure Message |
|---|---|
assertWorldAlive(Object world) | ”Expected world to be alive but it was not” |
When to Test Scheduling
Scheduling tests are most valuable when:- Your mod dispatches work to the world thread from async handlers
- You need to verify that the world is alive before running game logic
- You are building plugins that depend on the scheduling API being available
- You want to catch issues where a dedicated test world fails to start
IsolationStrategy.DEDICATED_WORLD when you need a guaranteed-alive world for scheduling tests.
Next Steps
- World Testing - world operations and tick waiting
- Chunks - chunk loading depends on world scheduling
- Persistence - world save operations