Skip to content

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.

public static ComponentType<EntityStore, NPCMountComponent> getComponentType()

Delegates to MountPlugin.getInstance().getMountComponentType().

public static final BuilderCodec<NPCMountComponent> CODEC

Serializes/deserializes the OriginalRoleIndex field as an integer.

MethodReturnsDescription
getOriginalRoleIndex()intThe NPC role index before mounting, used to restore the role on dismount.
getOwnerPlayerRef()@Nullable PlayerRefThe player who mounted this NPC, or null.
getAnchorX()floatX component of the player attachment offset.
getAnchorY()floatY component of the player attachment offset.
getAnchorZ()floatZ component of the player attachment offset.
MethodDescription
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
@Override
public Component<EntityStore> clone()

Returns a copy with all fields duplicated.

Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.