MountPlugin
Package: com.hypixel.hytale.builtin.mounts
public class MountPlugin extends JavaPluginThe main plugin class for the mount system. Registers all mount-related ECS components, systems, commands, interactions, and packet handlers. Maintains a static singleton instance used by components to resolve their ComponentType references.
Singleton Access
Section titled “Singleton Access”public static MountPlugin getInstance()Returns the singleton MountPlugin instance. Set during setup().
Constructor
Section titled “Constructor”public MountPlugin(@Nonnull JavaPluginInit init)Delegates to JavaPlugin(init).
Component Type Accessors
Section titled “Component Type Accessors”| Method | Returns |
|---|---|
getBlockMountComponentType() | ComponentType<ChunkStore, BlockMountComponent> |
getMountComponentType() | ComponentType<EntityStore, NPCMountComponent> |
getMountedComponentType() | ComponentType<EntityStore, MountedComponent> |
getMountedByComponentType() | ComponentType<EntityStore, MountedByComponent> |
getMinecartComponentType() | ComponentType<EntityStore, MinecartComponent> |
During setup(), the plugin performs the following registrations in order:
- ChunkStore component: BlockMountComponent on the chunk store registry.
- NPC core component: Registers
"Mount"viaNPCPlugin.get().registerCoreComponentType()with BuilderActionMount. - EntityStore components:
- NPCMountComponent with codec key
"Mount". - MountedComponent (no default constructor — throws
UnsupportedOperationException). - MountedByComponent.
- MinecartComponent with codec key
"Minecart".
- NPCMountComponent with codec key
- EntityStore systems: All systems from MountSystems and NPCMountSystems.
- ChunkStore system: MountSystems.RemoveBlockSeat.
- Packet handler: MountGamePacketHandler via
ServerManager. - Command: MountCommand (
/mount). - Interactions:
"SpawnMinecart","Mount", and"Seating"registered onInteraction.CODEC.
Static Utility Methods
Section titled “Static Utility Methods”checkDismountNpc
Section titled “checkDismountNpc”public static void checkDismountNpc(@Nonnull ComponentAccessor<EntityStore> store, @Nonnull Ref<EntityStore> ref, @Nonnull Player playerComponent)Checks if the player has a non-zero mount entity ID and, if so, initiates NPC dismount by resetting the mount’s role and the player’s movement settings.
resetOriginalPlayerMovementSettings
Section titled “resetOriginalPlayerMovementSettings”public static void resetOriginalPlayerMovementSettings(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> store)Sends a DismountNPC packet to the player client and resets the player’s MovementManager to default settings. Called when dismounting from an NPC mount.
Related Types
Section titled “Related Types”- MountSystems — entity mount ECS systems
- NPCMountSystems — NPC-specific mount ECS systems
- MountCommand —
/mountcommand collection - MountGamePacketHandler — dismount packet handler