Repository navigation
Animation Format
AnimCue extends standard Bedrock / GeckoLib / PAL animation JSON files (format_version: "1.8.0") by adding a single top-level interactive_animation:interactions object. Files without interactive_animation:interactions are ignored by AnimCue.
{
"format_version": "1.8.0",
"animations": {
"<animation_name>": {
"animation_length": 2.0,
"bones": { ... },
"timeline": {
"0.25": "marker_a",
"1.00": ["marker_b", "marker_c"]
}
}
},
"interactive_animation:interactions": {
"<animation_name>": {
"participants": [ ... ],
"camera": { ... }
}
}
}- Every key inside
interactive_animation:interactionsmust match an existing animation key insideanimations. - Each scene must declare between 1 and 64 entries in
participants. - Every participant must have a unique, non-empty
rolestring. - If
animation_lengthis present on the primary animation, no bone track, camera track,timelinemarker,sound_effectskeyframe, orparticle_effectskeyframe may exceedanimation_length(tolerance1e-5). If omitted, the scene length is computed from the last keyframe or marker timestamp.
Each object in participants supports:
| Field | Required | Type | Description |
|---|---|---|---|
role |
Yes | string |
Unique role name used by Bindings.named(...), SceneHandle, and ClientScenes.subjectFor(...). |
type |
No | string |
Default preview asset type: entity, item, block, or model (default: model). Case-insensitive. |
id |
Yes | string |
Resource identifier for the default asset (e.g. minecraft:player, minecraft:iron_sword, or a custom ID registered via ClientAssets.registerModel). |
bones |
No | object |
Map of bone name → channel tracks (position, rotation, scale, bend). |
sound_effects |
No | object |
Timed sound keyframes using the same format as primary sound_effects (dispatched with role set to the participant's role). |
particle_effects |
No | object |
Timed particle keyframes using the same format as primary particle_effects (dispatched with role set to the participant's role). |
Live instances passed through Bindings override the default preview asset at playback time.
The reserved bone name interactive_animation:root drives whole-participant spatial displacement and rotation relative to the primary SceneSubject.Frame:
-
position: Model units (16 units = 1 Minecraft block), transformed by the subject'syaw. -
rotation: Euler angles in degrees. Rotation values are not clamped to[-180, 180], so multi-turn spins (e.g.0→720) retain their authored winding. -
scale: Optional scale vector (default[1, 1, 1]).
Participants without a interactive_animation:root track still apply their skeletal bone tracks without moving their world entity position.
Each bone entry under bones may declare any combination of four channels:
-
position(default[0, 0, 0]) -
rotation(default[0, 0, 0]) -
scale(default[1, 1, 1]) -
bend(default[0, 0, 0], used for limb/torso bend adapters such as PAL More Rotation or legacy bend bridges)
Each channel accepts:
- A static 3-element numeric array
[x, y, z]or scalar number (expanded to[v, v, v]), - A single keyframe object with
pre/post, or - A timestamp map (
"0.0","0.25", ...) where every timestamp is a finite non-negative number in seconds.
Individual keyframes support discontinuous pre / post values and lerp_mode:
"left_leg": {
"rotation": {
"0.0": [-30, 0, 0],
"0.25": {
"post": [28, 0, 0],
"lerp_mode": "catmullrom"
},
"0.5": [-30, 0, 0]
},
"bend": {
"0.0": [18, 0, 0],
"0.25": {
"post": [64, 0, 0],
"lerp_mode": "catmullrom"
},
"0.5": [18, 0, 0]
}
}Supported lerp_mode values:
-
"linear"(default): linear interpolation betweenprevious.postandnext.pre. -
"catmullrom": Catmull-Rom cubic spline interpolation across neighboring keyframes.
Curve components accept finite numbers or MoLang string expressions (pure numeric curves automatically take a zero-allocation constant fast path).
AnimCue ships a built-in zero-dependency MoLang engine (degree-based Bedrock math.*, PAL MochaMathExtensions easing curves, 75+ standard q.* / query.* entity & world queries, per-scene persistent v.* / variable.*, local t.* / temp.*, c.* / context.*, ??, ?:, logical/comparison operators, ;, and return), usable in:
-
Transform curves: bone
position,rotation,scale,bend(including 3-axis PAL More Rotation),interactive_animation:root, andcamera([x, y, z],"vector","pre","post"). -
IK weights:
ik[].weightas a MoLang string or timestamped MoLang curve. -
Timeline scripts:
timelinestrings containing assignments/expressions (e.g."v.charge = (v.charge ?? 0) + 1;") execute automatically on the scene'sMolangVariableStorewhile still firing marker listeners; plain marker labels (e.g."hit_window") remain unaffected. -
Branch & State Machine conditions:
branches[].conditionandstate_machine.states.<name>.transitions[].conditionaccept MoLang boolean expressions directly (e.g."v.charge >= 2 && q.health > 5") alongside registered Java predicates. -
Sound & Particle keyframes:
sound_effects(volume,pitch,condition,pre_effect_script) andparticle_effects(count,speed,offset,condition,pre_effect_script).
When optional animation runtimes are installed, AnimCue automatically enables zero-reflection MoLang soft bridges (while keeping AnimCue's actor-scoped built-in queries authoritative for standard queries):
-
GeckoLib 4 & 5: reads custom mod-registered
query.*/variable.*(with activeGeoRenderStatescoped on GeckoLib 5). -
Kltyton Bedrock Runtime (KBR): resolves custom KBR
MolangQueries, client-syncedhas_target/is_in_loveviaIMolangEntityState, and bidirectionally syncs actorv.*variables. -
Player Animation Library (PAL 1.1/1.2 + Extensions): invokes
MolangEvent.MOLANG_EVENTso custom PAL extension queries work automatically alongside PAL More Rotation 3-axisbendexpressions. -
SimpleBedrockModel (SBM v1 & v2): covers all
MolangEntityContext/MolangLivingContextqueries natively and supports optionalSbmMolangBridge.bindContext(entity, sbmContext)for custom@QueryBindings andMutableObjectBindingvariable sync. -
Public SPI: register custom queries, math functions, or bridges via
MolangRegistry.registerQuery(...),registerQueryFunction(...),registerMathFunction(...), andregisterBridge(...), or read/write live scene variables viaSceneHandle#setVariable/getVariable.
An optional camera object may be placed alongside participants using the same channel structure (position and rotation in Bedrock coordinates/degrees):
"interactive_animation:interactions": {
"animation.example.intro": {
"participants": [ ... ],
"camera": {
"position": { "0.0": [0, 28, -48], "1.5": [16, 24, -40] },
"rotation": { "0.0": [12, 0, 0], "1.5": [8, -20, 0] }
}
}
}When PlaybackOptions.CameraMode.AUTO is selected, AnimCue drives the camera from this track when present, or falls back to smooth follow camera for participating players.
The primary animation's timeline map fires PlaybackOptions.Marker callbacks at the corresponding playback timestamp. Each timestamp may contain either a single string instruction or an array of string instructions:
"timeline": {
"0.16": "door_open",
"0.85": ["settle", "mount"]
}Standard Bedrock / GeckoLib sound_effects and particle_effects keyframes are also supported on both the primary animation and individual entries in participants (accepting an object, array, or plain effect ID string per timestamp):
"sound_effects": {
"0.25": {
"effect": "minecraft:entity.experience_orb.pickup",
"locator": "mouth"
},
"0.80": "minecraft:block.anvil.land"
},
"particle_effects": {
"0.40": {
"effect": "minecraft:crit",
"locator": "right_hand",
"pre_effect_script": "slash"
}
}By default, registered sound events and simple particle types play automatically at the owner's position for participant tracks and non-native primary tracks (nativePlayback = false), while native controllers (such as GeckoLib via GeckoSubjects) keep owning primary sound/particle keyframes to avoid duplicate firing. When Kltyton Bedrock Runtime (kltyton_bedrock_runtime, Lite or full) is installed alongside AnimCue, default particle keyframes also automatically dispatch KBR particle_definitions/*.json billboard and 3D model particles with pre_effect_script / script MoLang initialization expressions.
Alongside participants and camera, scenes may optionally declare:
-
anchors: Named dynamic target anchors resolving live client bone world transforms (Tier 1) with deterministic body-proportion / AABB fallback (Tier 2) on both server and client. Supportsrole,bone,offset(model pixels),semantic/fallback(feet,waist,chest,front_chest,back,neck,head,eye,left_shoulder,right_shoulder,left_hand,right_hand,weapon_grip,weapon_tip,mount_seat),clearance,margin, andground_snap. -
motion_warping(per participant): Time-windowed root-motion warping (hybrid_approach,skew_additive,scale_root_motion) with axis mask (xyz,xz,y), arc-length weighting (no foot sliding during static beats),warp_yaw,max_distance, andcollision(ignore,slide,abort_blocked). -
ik(per participant): Post-animation inverse kinematics (two_bone,aim,fabrik) driven by scalar weight curves and dynamic anchors. Single-bone humanoid limbs automatically upgrade to virtual two-bone bend IK when PAL / PlayerAnimator + bendy-lib is installed, and gracefully fall back to aim + bounded shoulder reach on pure vanilla models. -
branches: Runtime conditional branching (trigger:marker,window,end) with priority ordering, seamless control-lease continuity, and crossfade (blend_seconds). -
blend: Smoothinandouttransitions (linear,smoothstep,cubic_in_out,ease_out_quad) supportingtail_fadeand non-blockingpost_releaseblend-out. -
match: Dynamic scene matching metadata (sector,distance,elevation_delta,target_height,scale_ratio,target_entities,require_environment/forbid_environment,min_ceiling_clearance,priority,weight). -
state_machine: Multi-state graph withonce/loopingstates (max_loops,max_duration),qte_windows(single_press,hold_duration,mash_count), andtransitionssupportingpush_stack/pop_stackinterrupt sub-states. -
sockets&props: 6DoF named sockets (also referenced viaanchors.<id>.socket) and scene-owned virtual props capable of smooth socket-to-socket transfers. -
Extended
motion_warping: Multi-stagesync_points,align_to_slopepitch alignment, andcollision: "detour"local obstacle steering.