Timelines
Timelines control game behavior and visuals based on the absolute day time through environment attributes. They allow you to define tracks that animate environment attributes over time using keyframes and easing functions.
Timelines were added in snapshot 25w45a (Minecraft 1.21.11).
Basic Usage
Here's a simple example of creating a timeline that controls fog distance over a day cycle:
The timeline function creates and registers a timeline in your DataPack. It produces a file at data/<namespace>/timeline/<fileName>.json and returns a TimelineArgument.
Timeline Properties
| Property | Type | Description |
|---|---|---|
periodTicks |
Int |
Optional. Defines the duration in ticks over which the timeline repeats. Omit for no repetition |
Tracks
Tracks map environment attributes to keyframe-based animations. Each track specifies an easing type, an optional modifier, and a list of keyframes.
Track Properties
| Property | Type | Description |
|---|---|---|
ease |
EasingType |
The easing type for interpolation between keyframes. Default: linear |
modifier |
EnvironmentAttributeModifier |
The environment attribute modifier ID. Default: OVERRIDE |
keyframes |
List |
A list of keyframes defining values at specific ticks |
Keyframes
Each keyframe defines a value at a specific tick within the timeline period:
The value function accepts Float, Int, Boolean, String, Color, or any EnvironmentAttributesType (e.g., FloatValue, BooleanValue, ColorValue).
Using typed values with EnvironmentAttributesType:
Easing Types
Easing types control how values are interpolated between keyframes.
Non-interpolating Types
| Easing Type | Description |
|---|---|
Constant |
Always selects the value from the previous keyframe |
Linear |
Linearly interpolates between keyframes (lerp) |
Interpolating Types
Each interpolation kind is available in three forms: In*, Out*, and InOut*.
| Kind | Ease In | Ease Out | Ease In-Out |
|---|---|---|---|
| Back | InBack |
OutBack |
InOutBack |
| Bounce | InBounce |
OutBounce |
InOutBounce |
| Circ | InCirc |
OutCirc |
InOutCirc |
| Cubic | InCubic |
OutCubic |
InOutCubic |
| Elastic | InElastic |
OutElastic |
InOutElastic |
| Expo | InExpo |
OutExpo |
InOutExpo |
| Quad | InQuad |
OutQuad |
InOutQuad |
| Quart | InQuart |
OutQuart |
InOutQuart |
| Quint | InQuint |
OutQuint |
InOutQuint |
| Sine | InSine |
OutSine |
InOutSine |
Cubic Bezier
For custom easing curves, use CubicBezier with two control points:
This serializes as:
Environment Attributes
Tracks reference environment attributes from the EnvironmentAttributes sealed interface, organized into categories:
EnvironmentAttributes.Audio— Sound-related attributes (ambient sounds, music volume, etc.)EnvironmentAttributes.Gameplay— Gameplay mechanics (monster burning, bed rules, sky light level, etc.)EnvironmentAttributes.Visual— Visual effects (fog, clouds, sky color, particles, etc.)
Complete Example
Here's a complete example of a day/night cycle timeline:
See Also
- Environment Attributes - Environment attributes used in timeline tracks
- Tags - Use tags to group timelines
External Resources
- Minecraft Wiki: Timeline - Official JSON format reference
