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 aMountNPCpacket to the owning player with the anchor offset and network ID, sets the player’s mount entity ID, and removes theInteractablecomponent to prevent further interactions. - Without owner player: Resets the NPC to its original role via
RoleChangeSystem.requestRoleChange(), removes theNPCMountComponent, and re-ensures theInteractablecomponent. This handles the case where the mount component was loaded from persistence without an active player.
Matches entities with NPCMountComponent, NPCEntity, and NetworkId.
Behavior
Section titled “Behavior”- onEntityAdded: Processes the mount component as described above.
- onEntityRemove: No-op.
Related Types
Section titled “Related Types”- NPCMountSystems — enclosing class
- NPCMountComponent — the component being watched
- ActionMount — the NPC action that creates the component
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.