Interface SchedulerAdapter

All Known Implementing Classes:
FoliaScheduler, SpigotScheduler

public interface SchedulerAdapter
An abstraction layer for scheduling tasks across different Minecraft server implementations, such as Folia and Spigot.

Allows seamless compatibility by abstracting scheduling methods.

  • Method Details

    • runEntityTask

      SchedulerTask runEntityTask(Entity entity, Runnable runnable)
      Executes a task specifically linked to an entity immediately. On Spigot, this defaults to the global thread.
    • runEntityTaskLater

      SchedulerTask runEntityTaskLater(Entity entity, Runnable runnable, long delayTicks)
      Executes a task specifically linked to an entity after a delay. On Spigot, this defaults to the global thread.
      Parameters:
      delayTicks - Delay before execution, measured in ticks.
    • runEntityTaskTimer

      SchedulerTask runEntityTaskTimer(Entity entity, Runnable runnable, long delayTicks, long periodTicks)
      Executes a repeating task specifically linked to an entity. On Spigot, this defaults to the global thread.
      Parameters:
      delayTicks - Initial delay before the first execution (in ticks).
      periodTicks - Period between each subsequent execution (in ticks).
    • runRegionTask

      SchedulerTask runRegionTask(Location location, Runnable runnable)
      Executes a task associated with a specific region or chunk. On Spigot, this defaults to the global thread.
    • runRegionTask

      SchedulerTask runRegionTask(World world, int chunkX, int chunkZ, Runnable runnable)
      Executes a task associated with a specific region or chunk. On Spigot, this defaults to the global thread.
    • runRegionTaskLater

      SchedulerTask runRegionTaskLater(Location location, Runnable runnable, long delayTicks)
      Executes a task associated with a specific region or chunk after a delay. On Spigot, this defaults to the global thread.
      Parameters:
      delayTicks - Delay before execution, measured in ticks.
    • runRegionTaskLater

      SchedulerTask runRegionTaskLater(World world, int chunkX, int chunkZ, Runnable runnable, long delayTicks)
      Executes a task associated with a specific region or chunk after a delay. On Spigot, this defaults to the global thread.
      Parameters:
      delayTicks - Delay before execution, measured in ticks.
    • runRegionTaskTimer

      SchedulerTask runRegionTaskTimer(Location location, Runnable runnable, long delayTicks, long periodTicks)
      Executes a repeating task associated with a specific region or chunk. On Spigot, this defaults to the global thread.
      Parameters:
      delayTicks - Initial delay before the first execution (in ticks).
      periodTicks - Period between each subsequent execution (in ticks).
    • runRegionTaskTimer

      SchedulerTask runRegionTaskTimer(World world, int chunkX, int chunkZ, Runnable runnable, long delayTicks, long periodTicks)
      Executes a repeating task associated with a specific region or chunk. On Spigot, this defaults to the global thread.
      Parameters:
      delayTicks - Initial delay before the first execution (in ticks).
      periodTicks - Period between each subsequent execution (in ticks).
    • runTask

      SchedulerTask runTask(Runnable runnable)
      Executes a task on the global server thread.
    • runTaskAsynchronously

      SchedulerTask runTaskAsynchronously(Runnable runnable)
      Executes a task asynchronously immediately, off the main server thread.
    • runTaskLater

      SchedulerTask runTaskLater(Runnable runnable, long delayTicks)
      Executes a task on the global server thread after a specified delay.
      Parameters:
      delayTicks - Delay before execution, measured in server ticks (1 tick = 50ms).
    • runTaskLaterAsynchronously

      SchedulerTask runTaskLaterAsynchronously(Runnable runnable, long delayTicks)
      Executes an asynchronous task after a specified delay.
      Parameters:
      delayTicks - Delay before execution, measured in ticks.
    • runTaskTimer

      SchedulerTask runTaskTimer(Runnable runnable, long delayTicks, long periodTicks)
      Executes a repeating task on the global server thread.
      Parameters:
      delayTicks - Initial delay before the first execution (in ticks).
      periodTicks - Period between each subsequent execution (in ticks).
    • runTaskTimerAsynchronously

      SchedulerTask runTaskTimerAsynchronously(Runnable runnable, long delayTicks, long periodTicks)
      Executes an asynchronous repeating task.
      Parameters:
      delayTicks - Initial delay before the first execution (in ticks).
      periodTicks - Period between each subsequent execution (in ticks).