Overview
Minecraft time is measured in ticks (20 ticks = 1 second, 24 000 ticks = 1 day). Kore models this with TimeNumber, a typed value that carries both the numeric amount and the time unit (TICKS, SECONDS, DAYS).
Commands that accept a duration - schedule, title times, time add, weather, worldborder - take a TimeNumber argument, so you never have to remember the raw tick math yourself.
Creating time values
Use the extension properties on any Number:
Or use the time() factory for dynamic construction:
Serialization (command output)
TimeNumber.toString() produces what Minecraft commands expect:
| Expression | Output |
|---|---|
100.ticks |
100 |
1.5.ticks |
1.5 |
5.seconds |
5s |
1.5.seconds |
1.5s |
2.days |
2d |
0.2.days |
0.2d |
Integer values drop the .0 suffix; fractional values are preserved as-is.
Arithmetic
TimeNumber supports the standard operators (same unit required for meaningful results):
Unit conversions
Convert between units while keeping the logical duration the same:
toTicks() / toSeconds() / toDays() reinterpret the raw number without converting (rarely needed):
Usage in commands
Any command that takes a duration accepts TimeNumber directly:
Further reading
- Schedule command - scheduling functions with a delay
- Minecraft Wiki - Schedule command - vanilla
/schedulesyntax and behavior - Scheduler helper - OOP wrapper for recurring schedules
- Timers - OOP timer utilities built on ticks
- Minecraft Wiki - Tick
