How to cancel a task?

Discussion in 'Spigot Plugin Development' started by uGamerBidetti, Nov 10, 2018.

  1. I want to do it send one msg every 30 seconds for 5 minutes and when the 5 minutes finish stop sending the message
     
  2. Sort of pseudo ;-;? here you go
    Code (Java):
    new bukkitrunnable {
    int i = 0;
    public void run {
     if (i++ == 10){
       cancel();
        return;
       }

    // TODO your other code

      }
    }.runTaskTimer(yourJavaPluginClass, 0, 30*20);
     

Share This Page