How to set the target of a monster/animal?

Discussion in 'Plugin Development' started by Ahmet094, Sep 24, 2012.

Thread Status:
Not open for further replies.
  1. I tried many different ways, also looked into the source of other plugins, but somehow none of them works.. I can't set a zombies target.

    Example:
    Code:
    @EventHandler
        public void moveDetection(PlayerMoveEvent evt) {
     
                Player p = evt.getPlayer();
                List<Entity> zombies = p.getNearbyEntities(30, 30, 30);
                    LivingEntity spieler = p;
                    for (Entity e : zombies) {
                        if (e instanceof Zombie) {
                            ((Zombie) e).setTarget(spieler);
              }
            }
        }
    Thanks in advance!
     
  2. Offline

    XbannisherX

    becaus the setTarget() method is bugged, it doesnt work, not on hostile, or passive mobs :(
    did alot of research on it myself
     
Thread Status:
Not open for further replies.

Share This Page