Skip to content

ActionMount

Package: com.hypixel.hytale.builtin.mounts.npc

public class ActionMount extends ActionBase

An 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.

ConstantValueDescription
EMPTY_ROLE_ID"Empty_Role"The NPC role ID assigned while the NPC is being ridden.
FieldTypeDescription
anchorXfloatX component of the player attachment offset.
anchorYfloatY component of the player attachment offset.
anchorZfloatZ component of the player attachment offset.
movementConfigIdStringThe MovementConfig asset ID applied to the rider.
emptyRoleIndexintIndex of the "Empty_Role" in the NPC plugin registry.
public ActionMount(@Nonnull BuilderActionMount builderActionMount, @Nonnull BuilderSupport builderSupport)

Reads anchor offsets and movement config from the builder, resolves the "Empty_Role" index.

@Override
public 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.

@Override
public boolean execute(@Nonnull Ref<EntityStore> ref, @Nonnull Role role, InfoProvider sensorInfo, double dt, @Nonnull Store<EntityStore> store)
  1. If the NPC already has an NPCMountComponent, returns false.
  2. Creates an NPCMountComponent, sets the original role index, owner player, and anchor.
  3. Changes the NPC to "Empty_Role" via RoleChangeSystem.requestRoleChange().
  4. Loads the configured MovementConfig and applies it to the player’s MovementManager.
  5. Returns true on success.
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.