NPCInteractionSystems
Package: com.hypixel.hytale.server.npc.systems
public class NPCInteractionSystemsContainer class for two ECS systems that manage NPC-player interactions.
Inner Systems
Section titled “Inner Systems”NPCInteractionSystems.AddSimulationManagerSystem
Section titled “NPCInteractionSystems.AddSimulationManagerSystem”public static class AddSimulationManagerSystem extends HolderSystem<EntityStore>Adds an InteractionManager component to NPC entities that do not already have one. The interaction manager uses NPCInteractionSimulationHandler to handle NPC-side interaction logic.
Query: NPCEntity AND NOT InteractionManager
@Overridepublic void onEntityAdd(@Nonnull Holder<EntityStore> holder, @Nonnull AddReason reason, @Nonnull Store<EntityStore> store)Creates and adds an InteractionManager with the NPC component and a new NPCInteractionSimulationHandler.
NPCInteractionSystems.TickHeldInteractionsSystem
Section titled “NPCInteractionSystems.TickHeldInteractionsSystem”public static class TickHeldInteractionsSystem extends EntityTickingSystem<EntityStore>Ticks held interactions for NPC entities each frame. Processes Held, HeldOffhand, and all Equipped armor slot interactions.
Query: NPCEntity AND InteractionManager
@Overridepublic void tick( float dt, int index, @Nonnull ArchetypeChunk<EntityStore> archetypeChunk, @Nonnull Store<EntityStore> store, @Nonnull CommandBuffer<EntityStore> commandBuffer)For each NPC, calls InteractionManager.tryRunHeldInteraction() for:
InteractionType.Held(main hand)InteractionType.HeldOffhand(off hand)InteractionType.Equippedfor each armor slot (iterated by capacity)
Related Types
Section titled “Related Types”- RoleBuilderSystem — configures interactions during role setup
- NPCSystems — lifecycle systems
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.