-
Notifications
You must be signed in to change notification settings - Fork 0
Scheduler
zNotChill edited this page Sep 13, 2025
·
2 revisions
Blossom reimplements Minestom's scheduler system in a very basic way.
The run block provides you with the TaskManager parameter, allowing you to manage the task from inside the task.
The custom task function is available under SchedulerManager.task.
Tasks are automatically ran upon building.
MinecraftServer.getSchedulerManager().task {
repeat = 10.ticks
run = { task ->
if (MinecraftServer.getConnectionManager().onlinePlayers.isNotEmpty()) {
task.cancel() // or .stop()
println("too many players! canceling task!")
} else {
println("running task")
}
}
}