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
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
This split keeps the “can I use it?” check separate from the event or action that actually starts the cooldown.
Using a cooldown
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.
