World Clocks
Minecraft's time system is built around world clocks - named counters that advance every tick. Timelines animate environment attributes by reading from a clock. The /time command lets you read and manipulate clocks at runtime. Time markers are named tick positions inside a timeline that commands and predicates can reference.
All of these features were introduced alongside the environment-attributes overhaul in snapshot 26.1 and are fully supported in Kore's type-safe Kotlin DSL.
World Clock
A world clock is a data-driven resource with no properties. Its mere existence registers a named ticker under data/<namespace>/world_clock/<id>.json.
Each call registers the clock and returns a WorldClockArgument that you can pass to timelines, dimension types, and /time of commands.
File Structure
The generated JSON is an empty object:
Timelines
Timelines animate environment attributes by reading from a WorldClockArgument. Every track is a keyframe curve tied to one attribute; the timeline drives it forward as the clock ticks.
Creating a Timeline
timeline() produces data/<namespace>/timeline/<fileName>.json and returns a TimelineArgument.
Timeline Properties
| Property | Type | Description |
|---|---|---|
clock |
WorldClockArgument |
Required. Clock this timeline reads from. |
periodTicks |
Int? |
Loop period in ticks. Omit for a one-shot timeline that runs to the end. |
timeMarkers |
Map<String, TimelineMarker>? |
Named tick positions inside this timeline. See Time Markers. |
tracks |
Map<EnvironmentAttributeArgument, EnvironmentAttributeTrack>? |
Attribute animations. |
Tracks
Each track() call maps an EnvironmentAttributeArgument to an animation curve:
The value() function inside a keyframe block accepts Float, Int, Boolean, String, Color, or any EnvironmentAttributesType.
Easing Types
| Type | Description |
|---|---|
Constant |
Holds the previous keyframe value until the next one |
Linear |
Straight lerp between keyframes |
CubicBezier |
Custom four-point Bézier curve |
Interpolating variants are available as In*, Out*, and InOut* for: Back, Bounce, Circ, Cubic, Elastic, Expo, Quad, Quart, Quint, Sine.
Time Markers
Time markers are named tick positions inside a timeline. Commands can target them with /time set <timeMarker> to jump the clock to that exact position. They also serve as human-readable labels for /time query.
Defining Time Markers
showInCommands controls whether the marker appears in command auto-complete suggestions. When omitted (or null), the default game behaviour applies.
Referencing a Time Marker in Commands
Use TimeMarkerArgument (or the timeMarker() factory) to pass a marker to /time set:
The /time Command
Kore's time DSL mirrors the full Minecraft /time command tree. Access it via the time property on any Function:
Subcommands
| DSL call | Emitted command | Effect |
|---|---|---|
time.add(1000) |
time add 1000 |
Advance the default clock by 1000 ticks |
time.add(1.days) |
time add 1d |
Advance by one full day |
time.pause() |
time pause |
Freeze the default clock |
time.resume() |
time resume |
Unfreeze the default clock |
time.set(6000) |
time set 6000 |
Jump to tick 6000 |
time.set(TimePeriod.NOON) |
time set noon |
Jump to noon |
time.set(marker) |
time set <ns>:<name> |
Jump to a named time marker |
time.query(TimeType.DAYTIME) |
time query daytime |
Output current daytime |
time.query(timeline) |
time query <ns>:<timeline> |
Output progress through a timeline |
time.queryRepetitions(tl) |
time query <ns>:<tl> repetitions |
Output how many times the timeline has looped |
time.queryTime() |
time query time |
Output absolute game time |
Targeting a Specific Clock with time.of(clock)
When your datapack defines multiple world clocks, use time.of(clock) to scope every subcommand to that specific clock:
Or use the builder form to avoid repeating of(seasonClock):
time.of(clock) returns a TimeWithClock instance. It supports the same add, pause, resume, set, query, queryRepetitions, and queryTime methods as the default Time DSL.
timeCheck Predicate Condition
The timeCheck condition passes when the queried world time falls within a specified range. The optional clock parameter selects which clock to query; it defaults to the standard day clock.
Pass a period to apply a modulo first - useful for checking time within a repeating sub-cycle:
Target a specific world clock:
See Predicates for the full condition reference.
defaultClock in Dimension Type
DimensionType has an optional defaultClock field that selects which world clock drives the dimension's default time-dependent behaviour (sunrise/sunset, mob spawning light threshold, etc.). When omitted, the standard overworld day clock is used.
See World Generation for the full DimensionType reference.
Complete Example
The following snippet wires together all the concepts in this guide:
See Also
- Timelines - detailed track, keyframe, and easing reference
- Predicates - all available predicate conditions including
timeCheck - World Generation -
DimensionTypeand other worldgen resources - Environment Attributes - attributes available in timeline tracks
