HRTK stands for Hytale Runtime Testing Kit - a testing framework that runs inside the Hytale server, giving your tests access to real game state.
Why HRTK?
Traditional test frameworks like JUnit run outside the game. They can’t access Hytale’s ECS stores, world state, event system, or command pipeline. You end up mocking everything, and your mocks drift from reality. HRTK is different. Your tests run inside the live server as a plugin. They interact with realStore<EntityStore>, real EventRegistry, real CommandManager. When you deal damage in a test, Hytale’s actual DamageSystems.executeDamage() runs. When you spawn an entity, it exists in a real world.
24 Annotations
JUnit-familiar annotations like
@HytaleTest, @BeforeEach, @Tag, @Timeout - plus Hytale-specific ones like @EcsTest, @WorldTest, @FlowTest, @Benchmark12 Assert Classes
Domain-specific assertions:
EcsAssert, StatsAssert, CombatAssert, InventoryAssert, LootAssert, EffectAssert, EventAssert, CommandAssert, and more9 Test Adapters
Server-side adapters that wrap Hytale internals: deal damage, read stats, apply effects, check inventory, roll loot tables, capture events
Who is this for?
Mod Developers
Write tests alongside your mod code. Verify components persist, codecs round-trip, commands work, damage calculates correctly. Tests ship in your JAR and run when HRTK is installed.
Server Operators
Install HRTK on your dev server. Run
/hrtk run to execute all mod tests. Verify mods work correctly before deploying to production.What can you test?
Everything a mod touches:| Surface | What you can verify |
|---|---|
| ECS | Components persist, archetypes match, entity queries return correctly |
| Stats | Health/stamina/mana values, stat modifiers, alive/dead state |
| Combat | Damage reduces health, lethal damage causes death, knockback applies |
| Events | Events fire with correct data, cancellation works, priority ordering |
| Commands | Commands execute, output is correct, permissions enforced |
| Codecs | Serialization round-trips, malformed data rejected |
| Inventory | Items added/removed, slots contain expected stacks |
| Loot | Drop lists contain expected items, drops spawn after kills |
| Effects | Effects apply/expire, stat modifiers active, invulnerability works |
| World | Entities spawn at positions, chunks load, worlds create/destroy |
| UI | Pages build correct commands, event bindings registered |
| Performance | Benchmark with warmup/iteration control via TimeRecorder |
Quick Example
Get started
Write your first test in 5 minutes