// Go through all the entities and make them either attack
// the target or stop attacking
for (dEntity entity : entities) {
if (entity.isNPC()) {
Navigator nav = entity.getDenizenNPC().getCitizen().getNavigator();
if (cancel.equals(false)) {
nav.setTarget(target.getBukkitEntity(), true);
}
else {
// Only cancel navigation if the NPC is attacking something
if (nav.isNavigating()
&& nav.getTargetType().equals(TargetType.ENTITY)
&& nav.getEntityTarget().isAggressive()) {
nav.cancelNavigation();
}
}
}
else {
if (cancel.equals(false)) {