Cooldowns
Cooldowns use a scoreboard objective that decrements every tick. When the score reaches 0 the cooldown is ready. Durations are expressed as TimeNumber values - 2.seconds, 40.ticks, etc.
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.
Footprint
- Objectives: one per cooldown, named after it.
- Storage: none.
- Entities: none.
- Forceloaded chunks: none.
- Every tick:
cooldown_<name>_tickremoves 1 from every entity above 0. - Load and files:
cooldown_<name>_initcreates the objective. EachifReadyblock becomes acooldown_<name>_ready_<hash>function, listed in#kore:cooldown_ready_handlers.
Registering a cooldown
This generates:
- A load function that creates the scoreboard objective.
- A tick function that decrements the score of every entity with a score ≥ 1, players or not.
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 entity 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.
