Class EntitySelector

  • Direct Known Subclasses:
    MultipleEntitySelector

    public abstract class EntitySelector
    extends java.lang.Object
    A class to represent the result of parsing a Minecraft Entity/Target Selector argument
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected EntitySelector​(@NonNull java.lang.String selector, @NonNull java.util.List<@NonNull org.bukkit.entity.Entity> entities)
      Construct a new entity selector
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @NonNull java.util.List<@NonNull org.bukkit.entity.Entity> getEntities()
      Get the resulting entities
      @NonNull java.lang.String getSelector()
      Get the input String for this selector
      boolean hasAny()
      Check whether the selector selected at least one entity
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EntitySelector

        protected EntitySelector​(@NonNull java.lang.String selector,
                                 @NonNull java.util.List<@NonNull org.bukkit.entity.Entity> entities)
        Construct a new entity selector
        Parameters:
        selector - The input string used to create this selector
        entities - The List of Bukkit entities to construct the EntitySelector from
    • Method Detail

      • getEntities

        public @NonNull java.util.List<@NonNull org.bukkit.entity.Entity> getEntities()
        Get the resulting entities
        Returns:
        Immutable view of the list list of entities resulting from parsing the entity selector
      • getSelector

        public @NonNull java.lang.String getSelector()
        Get the input String for this selector
        Returns:
        The input String for this selector
      • hasAny

        public boolean hasAny()
        Check whether the selector selected at least one entity
        Returns:
        true if at least one entity was selected, else false