AnimationModifier is a record that configures how an animation should be played, including lerp timing, speed, loop behavior, and conditional execution.
Package
Record Components
| Component | Type | Description |
|---|---|---|
predicate | BooleanSupplier | Condition that must be true for animation to play (nullable) |
start | int | Lerp-in time in ticks |
end | int | Lerp-out time in ticks |
type | AnimationIterator.Type | Animation loop type (nullable, uses default if null) |
speed | FloatSupplier | Speed modifier supplier (nullable, 1.0 if null) |
override | Boolean | Whether to override existing animations (nullable) |
player | PlatformPlayer | Target player for this animation (nullable) |
Static Constants
DEFAULT
DEFAULT_WITH_PLAY_ONCE
Builder Methods
builder()
AnimationModifier.Builder
toBuilder()
Constructors
AnimationModifier(int, int)
AnimationModifier(int, int, float)
AnimationModifier(int, int, FloatSupplier)
AnimationModifier(int, int, AnimationIterator.Type)
AnimationModifier(int, int, AnimationIterator.Type, FloatSupplier)
AnimationModifier(BooleanSupplier, int, int, AnimationIterator.Type, FloatSupplier)
Instance Methods
type(AnimationIterator.Type)
speedValue()
predicateValue()
override(boolean)
Builder Class
TheAnimationModifier.Builder provides a fluent API for constructing modifiers.
Builder Methods
predicate(BooleanSupplier)
start(int)
end(int)
type(AnimationIterator.Type)
speed(float)
speed(FloatSupplier)
override(Boolean)
player(PlatformPlayer)
mergeNotDefault(AnimationModifier)
build()
AnimationModifier instance.
Usage Examples
Basic Animation with Lerp
Conditional Animation with Speed
Play Once Animation
Dynamic Speed Based on Game State
Override Existing Animations
Merging Modifiers
See Also
- AnimationIterator - Animation loop behavior
- BlueprintAnimation - Complete animation data
- TrackerAnimation - Animation configuration for trackers
