Solved Runnable Help (Hard to solve) Confusing :/

Discussion in 'Plugin Development' started by ShredNyx, Dec 5, 2013.

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

    ShredNyx

    My runnable doesnt stop when i added stopTask(id); Id is global :/
    Code:java
    1. id = Bukkit.getScheduler().scheduleSyncRepeatingTask(this, new Runnable(){
    2. public void run(){
    3. entity.getWorld().playEffect(entity.getLocation(), Effect.SMOKE, 25, 50);
    4. entity.getWorld().playEffect(entity.getLocation(), Effect.SMOKE, 25, 50);
    5. entity.getWorld().playEffect(entity.getLocation(), Effect.SMOKE, 25, 50);
    6.  
    7. entity.getWorld().playEffect(entity.getLocation(), Effect.SMOKE, 25, 50);
    8.  
    9. entity.getWorld().playEffect(entity.getLocation(), Effect.SMOKE, 25, 50);
    10.  
    11. entity.getWorld().playEffect(entity.getLocation(), Effect.EXTINGUISH, 25, 50);
    12.  
    13. if(entity.isDead()) {
    14. Bukkit.getScheduler().cancelTask(id);
    15.  
    16.  
    17. }}},0,20);
    18.  
    19. }
    20.  
    21.  
    22. }
    23. }


    Bump

    Anyone Sorry for unecessary bumps but no one has ever found a solution :/

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 5, 2016
  2. Offline

    JRL1004

    ShredNyx You're bumping too fast. Do not bump more than once every 24 hours. Also, are you defining the integer beforehand (like at the top of your class with "int id;") or something?
     
  3. Offline

    ShredNyx

  4. Offline

    JRL1004

    ShredNyx Okay, but I still can't help much with the current information. Can we see the entire class? It could be something from outside the part you posted.
     
  5. Offline

    ShredNyx

  6. Offline

    Windy Day

    It would help if you posted the whole class
     
Thread Status:
Not open for further replies.

Share This Page