Class Targets.Query
java.lang.Object
dev.myriadclient.api.combat.Targets.Query
- Enclosing class:
Targets
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 Summary
Modifier and TypeMethodDescription@Nullable net.minecraft.world.entity.Entitybest()The best match, or null if nothing matches (or outside a world); cheaper thanlist().getFirst().creative(boolean include) Include players in creative mode (on by default).An extra condition of your own; several calls add up (all must pass).friends(boolean include) Include friends (off by default).invisibles(boolean include) Include invisible entities (on by default).List<net.minecraft.world.entity.Entity> list()Every match among the entities the client has, best first; a new list, empty outside a world.named(boolean include) Include mobs with name tags (on by default; players always count).onlyAngry(boolean onlyAngry) Leave neutral mobs out until they're angry (off by default); seeTargets.type(Entity, boolean).range(double range) Maximum distance in blocks from your eyes to the nearest point of the hitbox (6 by default).sort(Targets.Sort sort) booleantest(net.minecraft.world.entity.Entity e) Whetherematches: alive, attackable, not you, of a wanted type, passing every option and within range.throughWalls(boolean include) Include entities you have no line of sight to (on by default).types(Targets.Type... types) Which kinds of entity count (players only by default).types(Set<Targets.Type> types) Which kinds of entity count, replacing the ones set before; the set is copied.
-
Method Details
-
range
Maximum distance in blocks from your eyes to the nearest point of the hitbox (6 by default). -
types
Which kinds of entity count (players only by default). -
types
Which kinds of entity count, replacing the ones set before; the set is copied. -
onlyAngry
Leave neutral mobs out until they're angry (off by default); seeTargets.type(Entity, boolean). -
friends
Include friends (off by default). -
invisibles
Include invisible entities (on by default). -
named
Include mobs with name tags (on by default; players always count). -
creative
Include players in creative mode (on by default). -
throughWalls
Include entities you have no line of sight to (on by default). -
sort
-
filter
An extra condition of your own; several calls add up (all must pass). -
test
public boolean test(net.minecraft.world.entity.Entity e) Whetherematches: alive, attackable, not you, of a wanted type, passing every option and within range. False outside a world. -
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 thanlist().getFirst().
-