Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

bukkit runnable repeating scheduler

// self cancelling example
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 :: l,og in android studio 
Java :: how to vibrate android java 
Java :: init cap java 
Java :: How to connect java class file to xml file 
Java :: how to install java 11 jdk on ubuntu 20.04 
Java :: Access denied finding property "camera.aux.packagelist" 
Java :: android back navigation 
Java :: find difference in days between two dates java 
Java :: processing draw circle 
Java :: javax.xml.bind does not exist 
Java :: how to echo java_home in windows cmd 
Java :: format localdate java 
Java :: Recompile with -Xlint:deprecation 
Java :: add days to date java 
Java :: null checker on addAll java 
Java :: string array to stream 
Java :: What AJAJ stand for 
Java :: how to parse json array in java 
Java :: Bukkit debug message 
Java :: java write string 
Java :: java convert double to string 
Java :: Youtube video thumbnail not load in android 11 or above progmatically 
Java :: java remove equal element of a list 
Java :: spring data rest format time 
Java :: java socket get ip address of client 
Java :: how to delete character certain index in java 
Java :: concurrent modification exception 
Java :: isprime java 
Java :: formartted string java 
Java :: short java 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =