Skip to content

SpawnEffect

Package: com.hypixel.hytale.server.npc.role

public interface SpawnEffect

Contract for spawning particle effects when an NPC appears in the world. Implementers provide a particle system ID, an offset from the NPC’s position, and a view distance for player visibility. The default spawnEffect method rotates the offset by the entity’s yaw, collects nearby players within the view distance using a spatial query, and dispatches the particle effect.

Return TypeSignature
StringgetSpawnParticles()
Vector3dgetSpawnParticleOffset()
doublegetSpawnViewDistance()
ModifierReturn TypeSignature
defaultvoidspawnEffect(@Nonnull Vector3d position, @Nonnull Vector3f rotation, @Nonnull ComponentAccessor<EntityStore> componentAccessor)

The default implementation: returns early if getSpawnParticles() is null or empty. Otherwise, applies the yaw rotation from rotation to the particle offset, adds the entity position, queries the player spatial resource for nearby players, and calls ParticleUtil.spawnParticleEffect.

Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.