Skip to main content

Overview

Animations bring your models to life. BetterModel’s animation system supports:
  • Keyframe-based animations from BlockBench
  • Multiple animation layers and blending
  • Per-player animations
  • Dynamic animation speed and conditions
  • Smooth interpolation and transitions

Animation Basics

Animations are defined in your .bbmodel file and loaded automatically with the model.

Playing Animations

src/main/java/com/example/BasicAnimation.java

Animation Types

Animations can loop or play once:
Animation Loop Types:
AnimationIterator.Type
Animation repeats indefinitely until stopped
AnimationIterator.Type
Animation plays once then automatically stops
AnimationIterator.Type
Animation plays once and holds the last frame

Animation Modifier

The AnimationModifier controls animation playback behavior.

Basic Usage

src/main/java/com/example/AnimationModifier.java

Lerp Transitions

Smooth transitions between animations:
Lerp (linear interpolation) values are in Minecraft ticks (1 tick = 50ms).

Animation Speed

Conditional Animations

Play animations only when conditions are met:
Predicates are checked every tick. Keep them lightweight to avoid performance issues.

Animation Override

Control whether new animations can interrupt current ones:

Per-Player Animations

Different animations for different players:
src/main/java/com/example/PerPlayerAnimation.java
Per-player animations use more resources. Use sparingly and only when necessary.

Stopping Animations

Stop by Name

Replace Animations

Replace one animation with another:

Animation Queries

Check animation state:

Advanced: TrackerAnimation

Create reusable animation sequences:
src/main/java/com/example/TrackerAnimation.java

Animation Best Practices

Smooth transitions improve visual quality:
Create animation sequences:
Use per-player animations sparingly:
Conditional animations for reactive behavior:
Dynamic speed for realistic movement:

Example: State Machine

src/main/java/com/example/AnimationStateMachine.java

Example: Combat Animations

src/main/java/com/example/CombatAnimations.java

See Also

Trackers

Managing tracker lifecycle

Bones & Hitboxes

Per-bone animation control

Conditional Animations

Dynamic animations with conditions

API Reference

Complete AnimationModifier API