MountedByComponent
Package: com.hypixel.hytale.builtin.mounts
public class MountedByComponent implements Component<EntityStore>An EntityStore ECS component that tracks which entities are currently riding a given mount entity. Maintained automatically by MountSystems.TrackedMounted when MountedComponent is added or removed from passenger entities.
Component Type
Section titled “Component Type”public static ComponentType<EntityStore, MountedByComponent> getComponentType()Delegates to MountPlugin.getInstance().getMountedByComponentType().
Methods
Section titled “Methods”getPassengers
Section titled “getPassengers”@Nonnullpublic List<Ref<EntityStore>> getPassengers()Returns the list of passenger entity references after removing any invalid references.
addPassenger
Section titled “addPassenger”public void addPassenger(Ref<EntityStore> passenger)Adds a passenger reference to the list.
removePassenger
Section titled “removePassenger”public void removePassenger(Ref<EntityStore> ref)Removes a passenger reference from the list.
withPassenger
Section titled “withPassenger”@Nonnullpublic MountedByComponent withPassenger(Ref<EntityStore> passenger)Fluent variant of addPassenger that returns this.
removeInvalid
Section titled “removeInvalid”public void removeInvalid()Removes all invalid (stale) references from the passenger list.
@Nonnull@Overridepublic Component<EntityStore> clone()Returns a new empty MountedByComponent. Passengers are not copied.
Related Types
Section titled “Related Types”- MountedComponent — the component on passenger entities
- MountSystems.TrackedMounted — system maintaining this component
- MountSystems.RemoveMountedBy — dismounts passengers on mount removal
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.