ActionMount
Package: com.hypixel.hytale.builtin.mounts.npc
public class ActionMount extends ActionBaseAn NPC action that enables a player to mount an NPC entity. Built from a BuilderActionMount configuration. When executed, creates an NPCMountComponent on the NPC, changes the NPC to an empty role, and applies a custom MovementConfig to the mounting player.
Constants
Section titled “Constants”| Constant | Value | Description |
|---|---|---|
EMPTY_ROLE_ID | "Empty_Role" | The NPC role ID assigned while the NPC is being ridden. |
Fields
Section titled “Fields”| Field | Type | Description |
|---|---|---|
anchorX | float | X component of the player attachment offset. |
anchorY | float | Y component of the player attachment offset. |
anchorZ | float | Z component of the player attachment offset. |
movementConfigId | String | The MovementConfig asset ID applied to the rider. |
emptyRoleIndex | int | Index of the "Empty_Role" in the NPC plugin registry. |
Constructor
Section titled “Constructor”public ActionMount(@Nonnull BuilderActionMount builderActionMount, @Nonnull BuilderSupport builderSupport)Reads anchor offsets and movement config from the builder, resolves the "Empty_Role" index.
Methods
Section titled “Methods”canExecute
Section titled “canExecute”@Overridepublic boolean canExecute(@Nonnull Ref<EntityStore> ref, @Nonnull Role role, InfoProvider sensorInfo, double dt, @Nonnull Store<EntityStore> store)Returns true if the base conditions are met and the interaction target exists without a DeathComponent.
execute
Section titled “execute”@Overridepublic boolean execute(@Nonnull Ref<EntityStore> ref, @Nonnull Role role, InfoProvider sensorInfo, double dt, @Nonnull Store<EntityStore> store)- If the NPC already has an
NPCMountComponent, returnsfalse. - Creates an
NPCMountComponent, sets the original role index, owner player, and anchor. - Changes the NPC to
"Empty_Role"viaRoleChangeSystem.requestRoleChange(). - Loads the configured
MovementConfigand applies it to the player’sMovementManager. - Returns
trueon success.
Related Types
Section titled “Related Types”- BuilderActionMount — builder/config for this action
- NPCMountComponent — the component created on the NPC
- NPCMountSystems.OnAdd — processes the component after creation
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.