Class Targets.Query

java.lang.Object
dev.myriadclient.api.combat.Targets.Query
Enclosing class:
Targets

public static final class Targets.Query extends Object
Which entities to find and in what order: set what differs from the defaults (Targets.query()), then call best() or list(). Every setter returns this query. A query can be kept and asked again each tick; it reads the world only when asked.
  • Method Details

    • range

      public Targets.Query range(double range)
      Maximum distance in blocks from your eyes to the nearest point of the hitbox (6 by default).
    • types

      public Targets.Query types(Targets.Type... types)
      Which kinds of entity count (players only by default).
    • types

      public Targets.Query types(Set<Targets.Type> types)
      Which kinds of entity count, replacing the ones set before; the set is copied.
    • onlyAngry

      public Targets.Query onlyAngry(boolean onlyAngry)
      Leave neutral mobs out until they're angry (off by default); see Targets.type(Entity, boolean).
    • friends

      public Targets.Query friends(boolean include)
      Include friends (off by default).
    • invisibles

      public Targets.Query invisibles(boolean include)
      Include invisible entities (on by default).
    • named

      public Targets.Query named(boolean include)
      Include mobs with name tags (on by default; players always count).
    • creative

      public Targets.Query creative(boolean include)
      Include players in creative mode (on by default).
    • throughWalls

      public Targets.Query throughWalls(boolean include)
      Include entities you have no line of sight to (on by default).
    • sort

      public Targets.Query sort(Targets.Sort sort)
      The order of list() and which one best() picks (Targets.Sort.DISTANCE by default).
    • filter

      public Targets.Query filter(Predicate<net.minecraft.world.entity.Entity> filter)
      An extra condition of your own; several calls add up (all must pass).
    • test

      public boolean test(net.minecraft.world.entity.Entity e)
      Whether e matches: alive, attackable, not you, of a wanted type, passing every option and within range. False outside a world.
    • list

      public List<net.minecraft.world.entity.Entity> list()
      Every match among the entities the client has, best first; a new list, empty outside a world.
    • best

      public @Nullable net.minecraft.world.entity.Entity best()
      The best match, or null if nothing matches (or outside a world); cheaper than list().getFirst().