Interface EntityScheduler
- All Superinterfaces:
Scheduler
A
Scheduler that schedules tasks for an Entity-
Method Summary
Modifier and TypeMethodDescriptionstatic EntitySchedulerget(org.bukkit.plugin.Plugin plugin, org.bukkit.entity.Entity entity) static booleanisEntityValid(org.bukkit.entity.Entity entity) Check if theEntityis valid.default TaskRun a taskRun a taskdefault TaskRun a task laterRun a task laterdefault TaskRun a task repeatedlydefault TaskrunTimer(BooleanSupplier runnable, long delay, long period) Run a task timerrunTimer(BooleanSupplier runnable, Runnable retired, long delay, long period) Run a task repeatedlyMethods inherited from interface io.github.projectunified.minelib.scheduler.common.scheduler.Scheduler
getExecutor, runTimer
-
Method Details
-
isEntityValid
static boolean isEntityValid(org.bukkit.entity.Entity entity) Check if theEntityis valid. This checks if the entity is not null and is still valid. ForPlayerentities, this also checks if the player is online.- Parameters:
entity- the entity- Returns:
trueif the entity is valid
-
get
- Parameters:
plugin- the pluginentity- the entity- Returns:
- the scheduler
-
run
Run a task- Parameters:
runnable- the runnableretired- the runnable called when the entity is retired- Returns:
- the task
-
runLater
Run a task later- Parameters:
runnable- the runnableretired- the runnable called when the entity is retireddelay- the delay in ticks- Returns:
- the task
-
runTimer
Run a task repeatedly- Parameters:
runnable- the runnable, returningtrueto continue orfalseto stopretired- the runnable called when the entity is retireddelay- the delay in ticksperiod- the period in ticks- Returns:
- the task
-
runTimer
Run a task repeatedly- Parameters:
runnable- the runnableretired- the runnable called when the entity is retireddelay- the delay in ticksperiod- the period in ticks- Returns:
- the task
-
run
Description copied from interface:SchedulerRun a task -
runLater
Description copied from interface:SchedulerRun a task later -
runTimer
Description copied from interface:SchedulerRun a task timer
-