Skip to content

NPC Systems

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

The NPC systems package contains 25 ECS system classes (totaling 69 types including inner classes) that implement the NPC behavior tick pipeline, spatial indexing, damage/death processing, interaction handling, spawn management, and debug visualization.

The NPC systems execute in a well-defined order each tick, established through dependency annotations:

OrderSystemPurpose
1NPCSpatialSystemUpdate the NPC spatial index
2PositionCacheSystems.UpdateSystemPopulate nearby entity caches
3RoleSystems.PreBehaviourSupportTickSystemClear steering, validate targets
4StateEvaluatorSystemUtility-AI state selection
5RoleSystems.BehaviourTickSystemCore instruction tree evaluation
6AvoidanceSystemEntity avoidance/separation steering
7SteeringSystemApply steering to motion controller
8RoleSystems.PostBehaviourSupportTickSystemCleanup, state updates
9ComputeVelocitySystemCompute velocity from position delta
10MovementStatesSystemUpdate movement state flags
11StepCleanupSystemRemove step debug component (runs last)
SystemPurpose
NPCSystems11 inner systems for add/remove, model change, death, teleport, kill feed
RoleBuilderSystemConstructs Role objects from JSON builder configs
BalancingInitialisationSystemSets up entity stats (health) from role
RoleChangeSystemProcesses queued runtime role changes
FailedSpawnSystemRemoves entities with failed role construction
NewSpawnStartTickingSystemEnables ticking for newly spawned entities
SystemPurpose
NPCDamageSystems5 inner systems: damage received/dealt, event view, filtering, item drops
NPCDeathSystems2 inner systems: death event view, NPC kills tracking
SystemPurpose
BlackboardSystems4 inner systems: init, periodic cleanup, block event forwarding
MessageSupportSystem5 inner systems: tick message slots for beacons and events
PositionCacheSystems3 inner systems: spatial cache update, role activation, flock join
SystemPurpose
SpawnReferenceSystems4 inner systems: spawn marker/beacon lifecycle and validation
SystemPurpose
NPCInteractionSystems2 inner systems: add interaction manager, tick held interactions
SystemPurpose
NPCPreTickSystemStore tick-start position, manage despawn timers
NPCSpatialSystemMaintain NPC spatial index
NPCVelocityInstructionSystemProcess velocity Set/Add instructions
ComputeVelocitySystemCompute velocity from position delta
MovementStatesSystemUpdate movement state flags from velocity
SystemPurpose
SteppableTickingSystemAbstract base respecting Frozen component
StepCleanupSystemRemove StepComponent at end of frame
TimerSystemTick all Tickable timers
FileTop-LevelInner Types
AvoidanceSystemAvoidanceSystem
BalancingInitialisationSystemBalancingInitialisationSystem
BlackboardSystemsBlackboardSystemsInitSystem, TickingSystem, BreakBlockEventSystem, DamageBlockEventSystem
ComputeVelocitySystemComputeVelocitySystem
FailedSpawnSystemFailedSpawnSystem
MessageSupportSystemMessageSupportSystemBeaconSystem, NPCBlockEventSystem, NPCEntityEventSystem, PlayerBlockEventSystem, PlayerEntityEventSystem
MovementStatesSystemMovementStatesSystem
NewSpawnStartTickingSystemNewSpawnStartTickingSystemQueueResource
NPCDamageSystemsNPCDamageSystemsDamageDealtSystem, DamageReceivedEventViewSystem, DamageReceivedSystem, DropDeathItems, FilterDamageSystem
NPCDeathSystemsNPCDeathSystemsEntityViewSystem, NPCKillsEntitySystem
NPCInteractionSystemsNPCInteractionSystemsAddSimulationManagerSystem, TickHeldInteractionsSystem
NPCPreTickSystemNPCPreTickSystem
NPCSpatialSystemNPCSpatialSystem
NPCSystemsNPCSystemsAddedSystem, AddedFromExternalSystem, AddedFromWorldGenSystem, AddSpawnEntityEffectSystem, OnDeathSystem, OnTeleportSystem, ModelChangeSystem, KillFeedDecedentEventSystem, KillFeedKillerEventSystem, LegacyWorldGenId, PrefabPlaceEntityEventSystem
NPCVelocityInstructionSystemNPCVelocityInstructionSystem
PositionCacheSystemsPositionCacheSystemsUpdateSystem, RoleActivateSystem, OnFlockJoinSystem
RoleBuilderSystemRoleBuilderSystem
RoleChangeSystemRoleChangeSystemRoleChangeQueue, RoleChangeRequest
RoleSystemsRoleSystemsBehaviourTickSystem, PreBehaviourSupportTickSystem, PostBehaviourSupportTickSystem, RoleActivateSystem, RoleDebugSystem
SpawnReferenceSystemsSpawnReferenceSystemsBeaconAddRemoveSystem, MarkerAddRemoveSystem, TickingSpawnBeaconSystem, TickingSpawnMarkerSystem
StateEvaluatorSystemStateEvaluatorSystem
SteeringSystemSteeringSystem
StepCleanupSystemStepCleanupSystem
SteppableTickingSystemSteppableTickingSystem
TimerSystemTimerSystem
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.