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?
Read through this tutorial http://forums.bukkit.org/threads/tutorial-how-to-customize-the-behaviour-of-a-mob-or-entity.54547/ Do the same thing for EntityZombie though, and than where you would have Code:java public CustomZombie(World world){ super(world); } under super(world); add a bukkit scheduler to have the entity (this) change its target to the nearest player. For that you would have to loop through each player and have it find which one is the closest and than target it.
I just did this, works the same Code:java Zombie snow4 = (Zombie)player.getWorld().spawn(loc, Zombie.class); EntityEquipment ee4 = snow4.getEquipment(); ee4.setHelmet(new ItemStack(Material.WOOL, 1, (byte)1)); snow4.setCustomName(ChatColor.GOLD + "" + ChatColor.BOLD + "Ghost"); snow4.setCustomNameVisible(true); snow4.addPotionEffect(new PotionEffect(PotionEffectType.SPEED,2147483647, 4)); snow4.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION,2147483647, 50)); snow4.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY,2147483647, 50)); snow4.addPotionEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST,2147483647, 50));