Class EntitySelector

java.lang.Object
ke.ric.renderer.api.EntitySelector

public final class EntitySelector extends Object
Immutable predicate over copied entity metadata. It never reads a live Bukkit entity and does not capture additional entities. Use types, UUIDs and living/player categories, then combine selectors with and(EntitySelector), or(EntitySelector) and not(). Selectors cannot override request exclusions or viewer privacy.
  • Method Details

    • all

      public static EntitySelector all()
      Matches every entity present in captured evidence.
      Returns:
      an unrestricted selector
    • none

      public static EntitySelector none()
      Matches no entity.
      Returns:
      an empty selector
    • living

      public static EntitySelector living()
      Matches metadata marked as living, including players.
      Returns:
      a living-entity selector
    • players

      public static EntitySelector players()
      Matches the captured namespaced type minecraft:player.
      Returns:
      a player selector
    • types

      public static EntitySelector types(String... namespacedTypes)
      Matches any supplied lowercase namespaced entity type. The values are defensively copied.
      Parameters:
      namespacedTypes - type keys such as minecraft:zombie; an empty array matches nothing
      Returns:
      a type selector
      Throws:
      IllegalArgumentException - for a null or malformed type key
    • ids

      public static EntitySelector ids(Collection<UUID> ids)
      Matches any supplied UUID without retaining the caller's collection.
      Parameters:
      ids - entity identities; an empty collection matches nothing
      Returns:
      an identity selector
      Throws:
      NullPointerException - if the collection or an element is null
    • ids

      public static EntitySelector ids(UUID... ids)
      Matches any supplied UUID; the array is defensively copied.
      Parameters:
      ids - entity identities; an empty array matches nothing
      Returns:
      an identity selector
      Throws:
      NullPointerException - if the array or an element is null
    • and

      public EntitySelector and(EntitySelector other)
      Requires both this selector and the supplied selector to match.
      Parameters:
      other - predicate to intersect
      Returns:
      an immutable intersection
    • or

      public EntitySelector or(EntitySelector other)
      Accepts a match from either this selector or the supplied selector. Capture exclusions and privacy still apply outside the selector.
      Parameters:
      other - predicate to union
      Returns:
      an immutable union
    • not

      public EntitySelector not()
      Negates this predicate within existing captured evidence.
      Returns:
      an immutable complement selector
    • matches

      public boolean matches(UUID id, String namespacedType, boolean living)
      Tests copied or caller-supplied metadata without reading Bukkit state.
      Parameters:
      id - entity UUID
      namespacedType - captured type key, such as minecraft:player
      living - whether the source metadata marks this entity as living
      Returns:
      whether this predicate accepts the metadata