taskAfter

fun Player.taskAfter(plugin: Plugin, delay: Ticks, task: () -> Unit): TaskHandle

Schedules a task to run after the specified delay and tracks it for this Player.

The task will be automatically cancelled when the player quits the server.

Return

a TaskHandle that can be used to cancel the task

Parameters

plugin

the Plugin instance to schedule the task under

delay

the amount of time to wait before running the task

task

the block of code to execute