Interface Selector


  • public interface Selector
    Allows for the selection of entities in a world based on given criteria.
    • Method Detail

      • parse

        static Selector parse​(java.lang.String string)
                       throws java.lang.IllegalArgumentException
        Attempts to parse the given string into a selector. It must start with an @ symbol.
        Parameters:
        string - The string to parse
        Returns:
        The Selector
        Throws:
        java.lang.IllegalArgumentException - if the string could not be parsed.
      • select

        java.util.Collection<Entity> select​(ServerLocation location)
                                     throws java.lang.IllegalStateException
        Select entities based on the criteria of this selector and a given ServerLocation
        Parameters:
        location - The ServerLocation
        Returns:
        A Collection of selected entities
        Throws:
        java.lang.IllegalStateException - if this selector cannot select based on a ServerLocation
      • select

        java.util.Collection<Entity> select​(Entity entity)
                                     throws java.lang.IllegalStateException
        Select entities based on the criteria of this selector and a given Entity
        Parameters:
        entity - The Entity
        Returns:
        A Collection of selected entities
        Throws:
        java.lang.IllegalStateException - if this selector cannot select based on a Entity
      • limit

        int limit()
        Gets the maximum number of entities that this selector can select.
        Returns:
        The limit
      • playersOnly

        boolean playersOnly()
        Gets whether this selector will only select players, or if it will select any Entity.
        Returns:
        Whether this selector will only select players