Little spawn code help

Discussion in 'Plugin Development' started by matanrak, Dec 23, 2013.

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

    matanrak

    I am working on a game that involves zombies and i want them to spawn here: x -1493 Y123.000 z-266.40076, in my other theared they helped with the clock
    Code:java
    1. public class P2 extends JavaPlugin implements Runnable
    2. {
    3. public void onEnable()
    4. {
    5. Bukkit.getScheduler().runTaskTimer(this, this, 100L, 100L);
    6. }
    7.  
    8.  
    9. public void run()
    10. {
    11.  
    12.  
    13.  
    14.  
    15. World world = Bukkit.getWorld("cw");
    16. Location spawnLoc = new Location(world, 1493, 123, 266);
    17. world.spawnCreature(spawnLoc, Zombie.class);
    18.  
    19.  
    20. }
    21. }

    But i want to add that every 5 min 10 zombies will spawn there but only if there are less then 3 zombies left in a redius of 10.
    can u please help me?
     
  2. Offline

    matanrak

  3. Offline

    Eistee²

Thread Status:
Not open for further replies.

Share This Page