Skip to main content
The Projectiles surface lets you verify that the server’s projectile module is present and accessible. ProjectileTestAdapter provides direct classpath checks, while ProjectileAssert wraps them as failing assertions. Projectile testing is important when your mod creates custom projectiles (arrows, spells, thrown items) or modifies projectile behavior. The first step is always verifying that the projectile module itself is available, since it may not be present in all server configurations.

Complete Example Suite

Adapter Methods

MethodReturnsDescription
projectileModuleExists()booleanCheck if the ProjectileModule class is on the classpath
getProjectileModule()ObjectGet the ProjectileModule singleton instance (returns null if unavailable)

Assertion Methods

MethodFailure Message
assertProjectileModuleAvailable()”Expected ProjectileModule to be available on the classpath but it was not found”

When to Test Projectiles

Projectile surface tests are primarily classpath availability checks. Use them as:
  • Precondition guards - Run these before any test that creates or inspects projectiles
  • Smoke tests - Verify that the server build includes the projectile module
  • Build validation - Catch missing dependencies in your mod’s build pipeline
For testing actual projectile behavior (trajectory, collision, damage), combine with the Physics and Stats & Combat surfaces using ECS component assertions.

Hytale Projectile System API

The Hytale server exposes a rich projectile system beyond what HRTK currently wraps:
  • ProjectileModule - The core plugin. Has get() singleton and spawnProjectile(UUID owner, Vector3d position, Vector3d velocity) for creating projectiles programmatically.
  • ProjectileConfig (asset) - Defines projectile properties. Has getPhysicsConfig(), getLaunchForce(), getMuzzleVelocity(), getGravity(), getModel().
  • StandardPhysicsConfig - Physics settings for projectiles. Has getGravity(), getBounciness(), getBounceCount(), getBounceLimit(), isSticksVertically().
  • ImpactConsumer (interface) - Callback when a projectile hits something: onImpact(projectileRef, position, hitEntityRef, hitType, commandBuffer).
  • BounceConsumer (interface) - Callback when a projectile bounces: onBounce(projectileRef, position, commandBuffer).
If your mod spawns custom projectiles, test the config asset properties directly:

Next Steps