Skip to content

Timer : Loop Async

Xenxia edited this page Feb 27, 2021 · 3 revisions
import fr.cheeseGrinder.bukkitTimer.Timer;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public class TestTimer {
    private final Timer timer;

    public TestTimer(JavaPlugin plugin) {
        this.timer = new Timer(plugin);
    }

    public void runLoopAsync() {
        // Loop 1 seconds callback was called
        timer.runLoopAsync(20, () -> {
            Bukkit.broadcastMessage("called after 1 seconds");
        });
    }
}
Clone this wiki locally