June 25, 201312 yr Is there anyway to see what is currently attacking your character, whether it be a player, a npc, or a random?
June 25, 201312 yr This would be helpful for the ATRareFinder script. If it detects a random or NPC is attacking it, It runs. If it's a player it teleports. Would cause much less deaths caused by people killing bots in wildy. :P
June 25, 201312 yr Author No, but you can get lazy and make some method to check each. I assume I could just get a list of the npcs around the area and check which one is facing my character. Any better ideas? This would be helpful for the ATRareFinder script. If it detects a random or NPC is attacking it, It runs. If it's a player it teleports. Would cause much less deaths caused by people killing bots in wildy. This would benefit a lot of things.
June 25, 201312 yr i do not think there is any other way.here you go public Entity[] getFacingEntity() { ArrayDeque<Entity> entities = new ArrayDeque<>(); for (NPC e : client.getLocalNPCs()) if (e.isFacing(myPlayer())) entities.add(e); for (Player e : client.getLocalPlayers()) if (e.isFacing(myPlayer())) entities.add(e); return entities.toArray(new Entity[entities.size()]); }