Skip to content

MountInteraction

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

public class MountInteraction extends SimpleInstantInteraction

An entity interaction that mounts the interacting player onto a target entity. Registered on Interaction.CODEC with the key "Mount" by MountPlugin.

public static final BuilderCodec<MountInteraction> CODEC

Extends SimpleInstantInteraction.CODEC with:

  • AttachmentOffset (Vector3f) — position offset from the mount point. Defaults to (0, 0, 0).
  • Controller (MountController enum) — the mount controller type. Required (validated non-null).
@Override
protected void firstRun(@Nonnull InteractionType type, @Nonnull InteractionContext context, @Nonnull CooldownHandler cooldownHandler)
  1. If no target entity exists, sets state to Failed.
  2. If the player already has a MountedComponent, removes it (dismounts) and sets state to Failed.
  3. If the target already has passengers (non-empty MountedByComponent), sets state to Failed.
  4. Otherwise, adds a MountedComponent to the player targeting the entity with the configured attachment offset and controller.
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.