Interface EntityScheduler
- All Superinterfaces:
Scheduler
A
Scheduler
that schedules tasks for an Entity
-
Method Summary
Modifier and TypeMethodDescriptionstatic EntityScheduler
get
(org.bukkit.plugin.Plugin plugin, org.bukkit.entity.Entity entity) static boolean
isEntityValid
(org.bukkit.entity.Entity entity) Check if theEntity
is valid.default Task
Run a taskRun a taskdefault Task
Run a task laterRun a task laterdefault Task
Run a task repeatedlydefault Task
runTimer
(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 theEntity
is valid. This checks if the entity is not null and is still valid. ForPlayer
entities, this also checks if the player is online.- Parameters:
entity
- the entity- Returns:
true
if 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, returningtrue
to continue orfalse
to 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:Scheduler
Run a task -
runLater
Description copied from interface:Scheduler
Run a task later -
runTimer
Description copied from interface:Scheduler
Run a task timer
-