i'm not sure how your source is but heres an example
add method in npchandler like this
This will make npc Index's attack each other NOT IDS!!
so make sure you figure out what each npcs index is so you can set them properly
i have it making npcs 1 attack 2
and 3 attack 4
and 5 attack 6
Choose 1 Of the 2 which ever you like better.
Code:
static {
setNPCAttackers();
}
public NPC() {
setNPCAttackers();
}
Then Add This Inside Your Npc Class And Change NPC to your npc class's name that holds the npc stuff.
Code:
private static final NPC[][] AUTO_ATTACK_NPCS = {{1,2},{3,4},{5,6}};
private static void setNPCAttackers() {
for(NPC[] n : AUTO_ATTACK_NPCS) {
NPCS[n[0]].setAlwaysAttack(NPCS[n[1]]);
NPCS[n[1]].setAlwaysAttack(NPCS[n[0]]);
}
}
Code:
private NPC alwaysAttack;
public void setAlwaysAttack(NPC n) {
alwaysAttack = n;
}
public NPC getAlwaysAttack() {
return alwaysAttack;
}