Package org.bukkit.entity

Examples of org.bukkit.entity.Zombie


   * @param e
   *            Entity to make into baby
   */
  public static void makeBaby(final LivingEntity e) {
    if (e instanceof Zombie) {
      Zombie z = (Zombie) e;
      if (!z.isBaby()) {
        z.setBaby(true);
      }
    } else if (e instanceof Villager) {
      if (((Villager) e).isAdult()) {
        ((Villager) e).setBaby();
      }
View Full Code Here


            // This is kind of messy, and can be improved upon.
            // TODO: Improve upon.
            else if (infected.getBukkitEntity() instanceof Villager) {
                Villager villager = (Villager) infected.getBukkitEntity();
                // Make a new entity
                Zombie infect = (Zombie) villager.getLocation().getWorld().spawnEntity(infected.getLocation(), EntityType.ZOMBIE);
                infect.setVillager(true);
                // Set health
                infect.setHealth(villager.getHealth());
                // Set equipment
                infect.getEquipment().setArmorContents(villager.getEquipment().getArmorContents());
                // Remove the Villager
                villager.remove();
                // Set the dEntity to the new entity
                infected.setEntity(infect);
            }
View Full Code Here

TOP

Related Classes of org.bukkit.entity.Zombie

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.