BukkitScheduler scheduler = Bukkit.getScheduler(); scheduler.scheduleAsyncRepeatingTask(plugin, new Runnable() { public void run() { // code to run every 20 ticks } }, 0L, 20L);
BukkitScheduler scheduler = Bukkit.getScheduler(); scheduler.scheduleSyncDelayedTask(plugin, new Runnable() { public void run() { // code to run once after 10 ticks } }, 10L);These are examples of Java code using the org.bukkit package, which is part of the Bukkit library for Minecraft plugins. The library provides a set of Java APIs for interacting with the Minecraft server, including scheduling tasks on the server's main thread or a separate thread.