coroutine

val Plugin.coroutine: CoroutineDispatcher

Gets or creates a CoroutineDispatcher for this plugin that dispatches work on the Bukkit main thread.

The dispatcher ensures that coroutines run on the primary server thread if already on it, or schedules them via Bukkit.getScheduler if called from another thread.

Return

A CoroutineDispatcher instance specific to this plugin.

Samples