No auto-agro mobs

Discussion in 'Plugin Development' started by hubeb, Jun 6, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    hubeb

    I need to make mobs (skeleton, zombies, etc.) not agro when player is in range. Any help would be appreciated. By non agro, like in creative mode where mobs don't notice you.
    Thanks,
    Hubeb
     
  2. Offline

    Rprrr

    Code:
    @EventHandler
    public void onEntityTarget(EntityTargetEvent e){
     
        if (e.getTarget() instanceof Player){
     
            Player p = (Player) e.getTarget();
     
            if (p.mayNotBeTargetted()){
     
                e.setCancelled(true);
     
            }
     
        }
     
    }
     
  3. Offline

    hubeb

    Cool man thanks, ill try it out and get back to you.
     
Thread Status:
Not open for further replies.

Share This Page