Solved Mob player detection

Discussion in 'Plugin Development' started by xepisolonxx, May 22, 2014.

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

    xepisolonxx

    How can i increase the mob detection of a giant?
    Code:
     if (!(sender instanceof Player)) {
                    sender.sendMessage(ChatColor.RED + "You cannot summon a giant!");
                    return true;
            }
           
            Player p = (Player) sender;
           
            if (cmd.getName().equalsIgnoreCase("giant")) {                   
                    if (!p.hasPermission("admin.giant")){
                        p.sendMessage(ChatColor.RED + "You don't have permsission for this!");
                    }else{
                        Giant g = (Giant) p.getWorld().spawnEntity(p.getLocation(),EntityType.GIANT);
                        g.addPotionEffect(new PotionEffect(PotionEffectType.SPEED,Integer.MAX_VALUE,3));
                        g.addPotionEffect(new PotionEffect(PotionEffectType.WEAKNESS,Integer.MAX_VALUE,3));
     
                        g.setCanPickupItems(false);
                        g.setMaxHealth(50.0);
                        g.setTarget(p);
                    }
                    }
            return false;
        }
        }
     
  2. Offline

    Garris0n

Thread Status:
Not open for further replies.

Share This Page