Solved Better Ai?

Discussion in 'Plugin Development' started by Meatiex, Nov 20, 2013.

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

    Meatiex

    Could I spawn a zombie that follows the closest player instead of getting the player it sees first and ignoring all others...
    Im making a Pacman arena, I want them to act like ghosts.

    So how would I improve the zombie's ai?
     
  2. Offline

    Ugleh

  3. Offline

    Meatiex

    I just did this, works the same :p
    Code:java
    1. Zombie snow4 = (Zombie)player.getWorld().spawn(loc, Zombie.class);
    2. EntityEquipment ee4 = snow4.getEquipment();
    3. ee4.setHelmet(new ItemStack(Material.WOOL, 1, (byte)1));
    4. snow4.setCustomName(ChatColor.GOLD + "" + ChatColor.BOLD + "Ghost");
    5. snow4.setCustomNameVisible(true);
    6. snow4.addPotionEffect(new PotionEffect(PotionEffectType.SPEED,2147483647, 4));
    7. snow4.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION,2147483647, 50));
    8. snow4.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY,2147483647, 50));
    9. snow4.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST,2147483647, 50));
     
Thread Status:
Not open for further replies.

Share This Page