Skip to content

NPCSpatialSystem

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

public class NPCSpatialSystem extends SpatialSystem<EntityStore>

Maintains the NPC spatial index for proximity queries. Updates the spatial structure each tick with the current positions of all NPC entities. Used by PositionCacheSystems and avoidance/separation steering.

public static final Query<EntityStore> QUERY = Archetype.of(NPCEntity.getComponentType(), TransformComponent.getComponentType())

Matches entities with both NPCEntity and TransformComponent.

public NPCSpatialSystem(@Nonnull ResourceType<EntityStore, SpatialResource<Ref<EntityStore>, EntityStore>> spatialResource)
@Nonnull
@Override
public Vector3d getPosition(@Nonnull ArchetypeChunk<EntityStore> archetypeChunk, int index)

Returns the entity’s position from its TransformComponent.

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