callSyncMethod

fun <T> callSyncMethod(task: Callable<T>): Future<T>

Calls a method on the main thread and returns a Future object. This task will be executed by the main(Bukkit)/global(Folia&Paper) server thread.
Note: The Future.get() methods must NOT be called from the main thread.
Note2: There is at least an average of 10ms latency until the isDone() method returns true.

Parameters

task

Task to be executed