BlockMountAPI
Package: com.hypixel.hytale.builtin.mounts
public final class BlockMountAPIStatic utility class for mounting entities onto block-based seats and beds. The class has a private constructor and exposes a single static method. It resolves the target block’s type, locates an available mount point, positions the entity, and attaches a MountedComponent to the entity.
Methods
Section titled “Methods”mountOnBlock
Section titled “mountOnBlock”@Nonnullpublic static BlockMountAPI.BlockMountResult mountOnBlock( @Nonnull Ref<EntityStore> entity, @Nonnull CommandBuffer<EntityStore> commandBuffer, @Nonnull Vector3i targetBlock, @Nonnull Vector3f interactPos)Attempts to mount the given entity onto a block at the specified position. The method:
- Checks the entity does not already have a
MountedComponent(returnsALREADY_MOUNTEDif so). - Resolves the world chunk and chunk reference for the target block.
- Looks up the
BlockTypeat the target position. - Determines whether the block has seats or beds; selects the corresponding
BlockMountType. - Ensures a BlockMountComponent exists on the chunk store for the block.
- Calls
findAvailableSeat()to pick the closest unoccupied mount point to the interaction position. - Positions the entity’s
TransformComponentat the mount point’s world-space position and rotation. - Adds a
MountedComponentto the entity and records the seated entity on theBlockMountComponent.
Returns a BlockMountResult: either a Mounted record on success or a DidNotMount enum value on failure.
Inner Types
Section titled “Inner Types”- BlockMountResult — sealed result interface
- DidNotMount — failure enum
- Mounted — success record
Related Types
Section titled “Related Types”- BlockMountComponent — chunk-store component tracking block seats
- MountedComponent — entity-store component marking an entity as mounted
- SeatingInteraction — block interaction that calls
mountOnBlock
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.