mcClientSyncLaunch
fun CoroutineScope.mcClientSyncLaunch(block: suspend CoroutineScope.() -> Unit): <Error class: unknown class>(source)
Does the same as launch, but the dispatcher defaults to mcClientCoroutineDispatcher.
This way, you can execute code synchronously (to the MinecraftServer main thread) very easily.
coroutineScope {
mcClientSyncLaunch {
// suspending and sync now
}
}Content copied to clipboard