Timeline
Timelines control game behavior and visuals based on the absolute day time through environment attributes.
JSON format
[edit | edit source]- [NBT Compound / JSON Object]: The root element of the timeline.
- [Int] period_ticks: Optional. Defines the duration in ticks over which the timeline will repeat. If omitted, the timeline will not repeat.
- [String] clock[upcoming JE 26.1]: One world clock (an [String] ID) to use for this timeline.
- [NBT Compound / JSON Object] tracks: A map between namespaced environment attribute IDs and a corresponding attribute track object.
- [NBT Compound / JSON Object]: An attribute track.
- [String][NBT Compound / JSON Object] ease: The easing type used to ease the interpolation between keyframes. Either a [String] string name of the interpolation type (see below) or an [NBT Compound / JSON Object] object with the field listed below. Default is
linear. Note that easing only has an effect for attributes which support interpolation.- [NBT List / JSON Array] cubic_bezier: A list of 4 [Double] doubles providing the coordinates of the 2 control points in the order x1, y1, x2, y2.
- [String] modifier: The ID of an environment attribute modifier. The default is
override. - [NBT List / JSON Array] keyframes: A list of keyframes for the track.
- [NBT Compound / JSON Object]: A keyframe.
- [Int] ticks: A value between 0 and
period_ticks(if specified) which defines the tick within the period at which the keyframe's value will be active. - [NBT Compound / JSON Object] value: The value for the attribute modifier.
- [Int] ticks: A value between 0 and
- [NBT Compound / JSON Object]: A keyframe.
- [String][NBT Compound / JSON Object] ease: The easing type used to ease the interpolation between keyframes. Either a [String] string name of the interpolation type (see below) or an [NBT Compound / JSON Object] object with the field listed below. Default is
- [NBT Compound / JSON Object]: An attribute track.
- [NBT Compound / JSON Object] time_markers[upcoming JE 26.1]: Map defining time markers.
- [Int][NBT Compound / JSON Object] <time marker id>: Definition of a time marker. Either an [Int] integer representing the tick of the marker or an [NBT Compound / JSON Object] object with the following fields:
- [Int] ticks: The tick of this marker.
- [Boolean] show_in_commands: Whether this marker should be suggested for the
/timecommand. Defaults tofalse.
- [Int][NBT Compound / JSON Object] <time marker id>: Definition of a time marker. Either an [Int] integer representing the tick of the marker or an [NBT Compound / JSON Object] object with the following fields:
Easing types
[edit | edit source]Note:
An easing type specifies the interpolation easing between keyframes of an attribute track.
Two easing types are available which do not interpolate into or out from keyframes:
| Easing type | Behavior |
|---|---|
constant
|
Always selects the value from the previous keyframe. |
linear
|
Linearly interpolates between the previous and next keyframes, also known as lerp. |
The rest of the easing types are all variations of a set of interpolation kinds, resized and moved to fit each segment of the track. Each is available in three forms; in_, out_, and in_out_. in_ applies the easing from the value of a keyframe after it's been passed, out_ applies the easing into the value of a keyframe before it's been passed, and in_out_ combines the two and applies the easing both from a keyframe and into the next one.
The types of easing which support in_, out_, and in_out_ are as follows:
| Interpolation kind | Ease in | Ease out | Ease in and out | Easing behavior | Ease-out formula |
|---|---|---|---|---|---|
back
|
in_back
|
out_back
|
in_out_back
|
Pulls back beyond the target value before easing into it. | |
bounce
|
in_bounce
|
out_bounce
|
in_out_bounce
|
Bounces against the target value 3 times before stopping. | |
circ
|
in_circ
|
out_circ
|
in_out_circ
|
Uses a circular curve to ease into the target value. | |
elastic
|
in_elastic
|
out_elastic
|
in_out_elastic
|
Wobbles around the target value 4 times. | |
sine
|
in_sine
|
out_sine
|
in_out_sine
|
Eases into the target value with a sinusoidal curve. | |
quad
|
in_quad
|
out_quad
|
in_out_quad
|
A quadratic curve with its origin at the target value. | |
cubic
|
in_cubic
|
out_cubic
|
in_out_cubic
|
A cubic curve with its origin at the target value. | |
quart
|
in_quart
|
out_quart
|
in_out_quart
|
A quartic curve with its origin at the target value. | |
quint
|
in_quint
|
out_quint
|
in_out_quint
|
A quintic curve with its origin at the target value. | |
expo
|
in_expo
|
out_expo
|
in_out_expo
|
An exponential curve with its origin at the starting value. |
History
[edit | edit source]| Java Edition | |||||||
|---|---|---|---|---|---|---|---|
| 1.21.11 | 25w45a | Added timelines to data packs. | |||||
| Upcoming Java Edition | |||||||
| 26.1 | snap3 | Added a clock field | |||||
Added an optional time_markers field | |||||||