The Task Provider provides a fluent, math-free API for scheduling both synchronous and asynchronous tasks in Minecraft. It is highly convenient because it does not require you to pass your plugin instance to every task, unlike Bukkit task scheduling.
Basic Tasks
Schedule a task to run immediately or with a delay.
// Run a synchronous task
Core.tasks.create(() -> {
player.sendMessage("This runs on the main thread!");
}).schedule();
// Run with a delay (in ticks)
Core.tasks.create(() -> {
player.sendMessage("One second later...");
}).delay(20L);
Repeating Tasks
Easily create repeating tasks.
Core.tasks.create(() -> {
System.out.println("Running every second!");
}).repeat(1L, 20L);