Zombies?

Discussion in 'Plugin Development' started by Wantsome909, Aug 21, 2013.

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

    Wantsome909

    So i'm trying to get it so when the server start a zombie will spawn but when killed it will re spawn after time.

    here code:
    Code:java
    1. ArrayList<Integer> zombies = new ArrayList<Integer>();
    2.  
    3. @EventHandler(priority=EventPriority.NORMAL)
    4. public void onEntityDeathEvent(EntityDeathEvent e){
    5. final Entity en = e.getEntity();
    6. if(en instanceof Zombie){
    7. new BukkitRunnable(){
    8. @Override
    9. public void run() {
    10. if(zombies.contains(en.getEntityId())){
    11. Bukkit.broadcastMessage("hey"); //debug message.
    12. }else{
    13. Location zom1 = new Location(en.getWorld(), 3, 44, 14);
    14. Zombie z = (Zombie) zom1.getWorld().spawn(zom1, Zombie.class);
    15. z.setCustomName(ChatColor.RED + "Zombie");
    16. z.setCustomNameVisible(true);
    17. zombies.add(z.getEntityId());
    18. }
    19. }
    20. }.runTaskLater(this.plugin, 10);
    21. }
    22. }


    and plus can you do multiple ones?
     
  2. Offline

    Rockon999

  3. Offline

    Wantsome909

    Rockon999 well, i have to kill a zombie to make a zombie spawn. So how could i make a zombie spawn with out killing another zombie?
     
  4. Offline

    Rockon999

Thread Status:
Not open for further replies.

Share This Page