for (Wolf w : wolves) w.setTarget(targetEntity); w.setAngry(true);
public void attackTarget(LivingEntity target) { double range = 5; Player player = getPlayer(); for (Entity entity : player.getNearbyEntities(range, range, range)) { if (entity.getType() != EntityType.WOLF) { continue; } Wolf wolf = (Wolf) entity; if (!wolf.isTamed() || (wolf.getOwner() != player) || wolf.isSitting()) { continue; } wolf.setTarget(target); } }