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.
Constructor
Section titled “Constructor”public NPCSpatialSystem(@Nonnull ResourceType<EntityStore, SpatialResource<Ref<EntityStore>, EntityStore>> spatialResource)Position Extraction
Section titled “Position Extraction”@Nonnull@Overridepublic Vector3d getPosition(@Nonnull ArchetypeChunk<EntityStore> archetypeChunk, int index)Returns the entity’s position from its TransformComponent.
Related Types
Section titled “Related Types”- PositionCacheSystems — uses the NPC spatial resource to populate nearby-entity caches
- AvoidanceSystem — uses spatial data for avoidance steering
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.