NPCMountComponent
Package: com.hypixel.hytale.builtin.mounts
public class NPCMountComponent implements Component<EntityStore>An EntityStore ECS component storing NPC-specific mount state. Tracks the NPC’s original role index (to restore on dismount), the owning player reference, and the anchor position offset where the player attaches to the NPC.
Serialized with codec key "Mount" and a BuilderCodec that persists OriginalRoleIndex.
Component Type
Section titled “Component Type”public static ComponentType<EntityStore, NPCMountComponent> getComponentType()Delegates to MountPlugin.getInstance().getMountComponentType().
public static final BuilderCodec<NPCMountComponent> CODECSerializes/deserializes the OriginalRoleIndex field as an integer.
Accessors
Section titled “Accessors”| Method | Returns | Description |
|---|---|---|
getOriginalRoleIndex() | int | The NPC role index before mounting, used to restore the role on dismount. |
getOwnerPlayerRef() | @Nullable PlayerRef | The player who mounted this NPC, or null. |
getAnchorX() | float | X component of the player attachment offset. |
getAnchorY() | float | Y component of the player attachment offset. |
getAnchorZ() | float | Z component of the player attachment offset. |
Mutators
Section titled “Mutators”| Method | Description |
|---|---|
setOriginalRoleIndex(int originalRoleIndex) | Sets the original role index. |
setOwnerPlayerRef(PlayerRef ownerPlayerRef) | Sets the owning player reference. |
setAnchor(float x, float y, float z) | Sets the anchor attachment offset. |
@Nonnull@Overridepublic Component<EntityStore> clone()Returns a copy with all fields duplicated.
Related Types
Section titled “Related Types”- NPCMountSystems — systems reacting to this component
- ActionMount — NPC action that creates this component
- MountPlugin — registers this component type
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.