yfoo Posted December 15, 2023 Share Posted December 15, 2023 (edited) In a single combat area where NPCs are aggressive to the player. How do I determine which NPC attacked me without attacking back. public static List<NPC> getNpcsAggroed(Bot bot) { MethodProvider methods = bot.getMethods(); return methods.npcs.filter(npc -> npc.getInteracting() != null && npc.getInteracting().equals(methods.myPlayer())); } ^ Above narrows it down to which NPCs instances would attack me. NPCs also don't deaggro just because one attacked me. public static List<NPC> getNPCImInteractingWith(Bot bot) { MethodProvider methods = bot.getMethods(); return methods.npcs.filter(npc -> methods.myPlayer().isInteracting(npc)); } ^ Only gets the npc after player starts attacking it. Edited December 15, 2023 by yfoo Quote Link to comment Share on other sites More sharing options...
Czar Posted December 15, 2023 Share Posted December 15, 2023 Add an extra filter and check for npc animation != -1 1 Quote Link to comment Share on other sites More sharing options...