Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

spigot self cancelling task

new BukkitRunnable() {
	int timer = 10;

	@Override
	public void run() {
		if (timer == 0) cancel();
        else Bukkit.broadcastMessage("Starting in: " + timer--);
	}

	@Override // this code can be in run(), its here as a possibility
	public synchronized void cancel() throws IllegalStateException {
        Bukkit.broadcastMessage("Action!");
		super.cancel();
	}
}.runTaskTimer(Main.main(), 0L, 20L); // repeat every second
Comment

PREVIOUS NEXT
Code Example
Java :: lcm 
Java :: how to import a self written class in java 
Java :: android studio how to move a picture canvas 
Java :: number of zeros in a binary array 
Java :: 8233*4 
Java :: android studio epoch to localdatetime 
Java :: java take inpt into arraylist 
Java :: java to run colored lines 
Java :: how to find all apps on android device using java 
Java :: exception in thread "main" java.lang.arrayindexoutofboundsexception: 10 
Java :: how to apply validation on aiphanumeric series starting with 4 characters with 4 letters in java 
Java :: compile option in android 
Java :: Path to home directory java 
Java :: how to iterate list in java selenium 
Java :: how to fix this problem in java - Exception in thread "main" java.lang.IllegalArgumentException: input == null! at java.desktop/javax.imageio.ImageIO.read(ImageIO.java:1358) 
Java :: zebra zpl print java 
Java :: android studio see what activity you came from 
Java :: write a code to print second last word of input string 
Java :: Write a java program to merge three singly linked list elements 
Java :: 2d matrix 
Java :: Caused by: java.lang.IllegalStateException: stream has already been operated upon or closed 
Java :: get string match percentage java 
Java :: java singleton with synchronized double check 
Java :: how to create space between element in vbox in javafx 
Java :: castle stones java qn 
Java :: url encode not working spring boot oauth2 
Java :: ein wort in buchstaben zerlegen java 
Java :: use scanner class in global scope java 
Java :: java 8 if else in one statement 
Java :: Static And Public Methods 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =