public void update(final int start, final int end) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = start; i < end; i++) {
                    monsters.get(i).update();
                    if (!GameServer.users.isEmpty()) {
                        double min = 10000;
                        Player cl = null;
                        for (Player user : GameServer.players) {
                            double dist = Math.sqrt(Math.pow(user.getX() - monsters.get(i).getY(), 2) + Math.pow(user.getY() - monsters.get(i).getY(), 2));
                            if (dist < min) {
                                cl = user;
                                min = dist;
                            }
                        }
                        if(cl!=null)monsters.get(i).setTarget(cl.getX(), cl.getY() + new Random().nextInt(32));
                        GameServer.sendToAll(monsters.get(i).toString());
                    }
                }
            }
        }).start();

    }