Skip to content

NPCMountSystems.OnAdd

Package: com.hypixel.hytale.builtin.mounts

public static class OnAdd extends RefSystem<EntityStore>

Handles NPCMountComponent addition on NPC entities. When an NPC gains a mount component:

  • With owner player: Resolves the NPC’s NetworkId, sends a MountNPC packet to the owning player with the anchor offset and network ID, sets the player’s mount entity ID, and removes the Interactable component to prevent further interactions.
  • Without owner player: Resets the NPC to its original role via RoleChangeSystem.requestRoleChange(), removes the NPCMountComponent, and re-ensures the Interactable component. This handles the case where the mount component was loaded from persistence without an active player.

Matches entities with NPCMountComponent, NPCEntity, and NetworkId.

  • onEntityAdded: Processes the mount component as described above.
  • onEntityRemove: No-op.
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.