Skip to content

Timer : Loop Sync

Xenxia edited this page Feb 27, 2021 · 1 revision
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 runLoopSync() {
        // Loop 1 seconds callback was called
        timer.runLoopSync(20, () -> {
            Bukkit.broadcastMessage("called after 1 seconds");
        });
    }
}
Clone this wiki locally