anim_keyframes and sound_keyframes
Read animation and sound frames from BDEngine exports. Understand command order, sparse indices, stepTicks, durationTicks, and execution context.
Frames contain arrays of Minecraft command strings. Server API provides them along with timing metadata. Your integration schedules and executes them.
anim_keyframes
Path: content.datapack.anim_keyframes.
Structure: animation key → frame index → command array.
An illustrative fragment of content containing one animation:
{ "datapack": { "anim_keyframes": { "turn": { "0": ["data merge entity @e[type=minecraft:block_display,tag=my_model_0,limit=1] {interpolation_duration:2}"], "3": ["data merge entity @e[type=minecraft:block_display,tag=my_model_0,limit=1] {interpolation_duration:0}"] } } }, "meta": { "schema": 1, "animations": { "turn": { "name": "Turn", "durationTicks": 10, "stepTicks": 2 } }, "sounds": {} }}These commands demonstrate the frame format; they do not form a complete turning animation. The turn key links the frames to meta.animations.turn. The display name comes from name. Use the keys in the response instead of reconstructing them from display names.
sound_keyframes
Path: content.datapack.sound_keyframes.
The structure is similar: sound sequence key → time index → command array.
{ "datapack": { "sound_keyframes": { "chime": { "0": [], "2": ["playsound minecraft:block.note_block.pling block @a ~ ~ ~ 1 1"], "5": ["playsound minecraft:block.note_block.pling block @a ~ ~ ~ 0.8 1.2"] } } }, "meta": { "schema": 1, "animations": {}, "sounds": { "chime": { "name": "Chime", "durationTicks": 20, "stepTicks": 4 } } }}This illustrative example begins with a pause. The current exporter retains frame zero even when it contains no sound, along with frames that contain events. Gaps without events do not have to appear as individual entries. Sequences with no notes are omitted from both the sound frame sets and their metadata.
Time keys, units, and gaps
Indices are numeric strings used as JSON keys. Determine an event’s time from its entry in meta.animations or meta.sounds:
time in game ticks = frame index × stepTicks| Example | Index | stepTicks |
Event time |
|---|---|---|---|
Animation turn |
"3" |
2 | 6 game ticks |
Sound chime |
"2" |
4 | 8 game ticks |
Sound chime |
"5" |
4 | 20 game ticks |
durationTicks specifies the duration independently of the event list. In turn, the last command shown occurs at tick 6, while the duration is 10 ticks. Neither the number of entries nor the last available index replaces this field.
The current exporter usually uses a 2-tick animation step. Transforms requiring intermediate frames use a 1-tick step. Sound sequences can use steps of 1, 2, or 4 ticks. Always read stepTicks from the corresponding metadata entry.
A missing index means no commands were recorded at that time; it does not shift the next event. An empty array also means there are no commands. Read numeric keys in numeric order: "10" comes after "2".
interpolation_duration inside a command is a Minecraft parameter. It cannot replace stepTicks. In older data without metadata, the timeline cannot be reliably inferred from the keys alone.
Command order and execution context
Preserve the order of strings within a frame: state preparation and subsequent actions may depend on each other. Exports can contain commands affecting displays, hitboxes, cameras, time of day, particles, and custom timeline commands.
Strings may use:
- Entity selectors based on model and part tags.
- Relative coordinates (
~) that depend on the execution position. - The
@scontext, changed by nestedexecute asandexecute atcommands. - References to Minecraft predicates and functions.
The API does not provide a universal command executor or model spawn location. Your integration provides the required context and resources. For example, sound commands use a relative execution position, while camera commands target a helper entity with the model’s tag. Substituting tag alone does not create those entities.
See Export support and limitations for resource and channel limitations, and JSON structure for metadata details.