Interface EntityScheduler

All Superinterfaces:
Scheduler

public interface EntityScheduler extends Scheduler
A Scheduler that schedules tasks for an Entity
  • Method Details

    • isEntityValid

      static boolean isEntityValid(org.bukkit.entity.Entity entity)
      Check if the Entity is valid. This checks if the entity is not null and is still valid. For Player entities, this also checks if the player is online.
      Parameters:
      entity - the entity
      Returns:
      true if the entity is valid
    • get

      static EntityScheduler get(org.bukkit.plugin.Plugin plugin, org.bukkit.entity.Entity entity)
      Get the EntityScheduler for the given Plugin and Entity
      Parameters:
      plugin - the plugin
      entity - the entity
      Returns:
      the scheduler
    • run

      Task run(Runnable runnable, Runnable retired)
      Run a task
      Parameters:
      runnable - the runnable
      retired - the runnable called when the entity is retired
      Returns:
      the task
    • runLater

      Task runLater(Runnable runnable, Runnable retired, long delay)
      Run a task later
      Parameters:
      runnable - the runnable
      retired - the runnable called when the entity is retired
      delay - the delay in ticks
      Returns:
      the task
    • runTimer

      Task runTimer(BooleanSupplier runnable, Runnable retired, long delay, long period)
      Run a task repeatedly
      Parameters:
      runnable - the runnable, returning true to continue or false to stop
      retired - the runnable called when the entity is retired
      delay - the delay in ticks
      period - the period in ticks
      Returns:
      the task
    • runTimer

      default Task runTimer(Runnable runnable, Runnable retired, long delay, long period)
      Run a task repeatedly
      Parameters:
      runnable - the runnable
      retired - the runnable called when the entity is retired
      delay - the delay in ticks
      period - the period in ticks
      Returns:
      the task
    • run

      default Task run(Runnable runnable)
      Description copied from interface: Scheduler
      Run a task
      Specified by:
      run in interface Scheduler
      Parameters:
      runnable - the runnable
      Returns:
      the task
    • runLater

      default Task runLater(Runnable runnable, long delay)
      Description copied from interface: Scheduler
      Run a task later
      Specified by:
      runLater in interface Scheduler
      Parameters:
      runnable - the runnable
      delay - the delay in ticks
      Returns:
      the task
    • runTimer

      default Task runTimer(BooleanSupplier runnable, long delay, long period)
      Description copied from interface: Scheduler
      Run a task timer
      Specified by:
      runTimer in interface Scheduler
      Parameters:
      runnable - the runnable, returning true to continue or false to stop
      delay - the delay in ticks
      period - the period in ticks
      Returns:
      the task