Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

spigot bukkit self cancelling task timer example repeat times

new BukkitRunnable() {
  	// int repeats = 10; // timer example
  
	@Override
	public void run() {
      // if (repeats == 0) cancel(); // timer example
      // repeats--; // timer example
      
      // your code
    }
}.runTaskTimer(plugin, 0L, 20L); // 0 ticks delay, every 20 ticks
Source by bukkit.org #
 
PREVIOUS NEXT
Tagged: #spigot #bukkit #cancelling #task #timer #repeat #times
ADD COMMENT
Topic
Name
9+1 =