Cooldowns

Cooldowns use a scoreboard objective that decrements every tick. When the score reaches 0 the cooldown is ready.

They are a good fit for abilities, interactions, item usage limits, or any mechanic that should be reusable for several players without hand-writing the decrement logic every time.

Registering a cooldown

val cd = registerCooldown("attack_cd", 2.seconds)
Kotlin

This generates:

  • A load function that creates the scoreboard objective.
  • A tick function that decrements the score for all players with score ≥ 1.

Typical usage pattern

function("dash_skill") {
	with(cd) {
		ifReady(player) {
			say("Dash!")
		}
	}
}

function("dash_hit") {
	cd.start(player)
}
Kotlin

This split keeps the “can I use it?” check separate from the event or action that actually starts the cooldown.

Using a cooldown

function("combat") {
	with(cd) {
		start(player)               // sets the score to the duration
		ifReady(player) {           // runs only when score == 0, then restarts
			say("Attack ready!")
		}
		reset(player)               // forces score to 0
	}
}
Kotlin

Function reference

Function Description
start Set the player score to the configured duration
ifReady Run a block only when the cooldown is ready
reset Force the cooldown back to 0
tick hook Auto-generated function that decrements active cooldown scores

See also

  • Timers – Use timers when you need scheduled callbacks rather than per-player readiness checks.
  • Events – Start or reset cooldowns from gameplay triggers such as clicks, kills, or item use.
  • State Delegates – Reduce scoreboard boilerplate in adjacent stateful systems.