SpawnEffect
Package: com.hypixel.hytale.server.npc.role
public interface SpawnEffectContract 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.
Abstract Methods
Section titled “Abstract Methods”| Return Type | Signature |
|---|---|
String | getSpawnParticles() |
Vector3d | getSpawnParticleOffset() |
double | getSpawnViewDistance() |
Default Methods
Section titled “Default Methods”| Modifier | Return Type | Signature |
|---|---|---|
default | void | spawnEffect(@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.