Skip to content

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.

public static ComponentType<EntityStore, MountedByComponent> getComponentType()

Delegates to MountPlugin.getInstance().getMountedByComponentType().

@Nonnull
public List<Ref<EntityStore>> getPassengers()

Returns the list of passenger entity references after removing any invalid references.

public void addPassenger(Ref<EntityStore> passenger)

Adds a passenger reference to the list.

public void removePassenger(Ref<EntityStore> ref)

Removes a passenger reference from the list.

@Nonnull
public MountedByComponent withPassenger(Ref<EntityStore> passenger)

Fluent variant of addPassenger that returns this.

public void removeInvalid()

Removes all invalid (stale) references from the passenger list.

@Nonnull
@Override
public Component<EntityStore> clone()

Returns a new empty MountedByComponent. Passengers are not copied.

Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.