December 15, 20232 yr 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, 20232 yr by yfoo
Create an account or sign in to comment