ModelAnimation

@ApiStatus.Internal
class ModelAnimation : Record

Represents a raw animation definition from a model file.

This record holds the properties of an animation, such as its name, length, loop mode, and the animators that define the keyframes for each bone group.

Since

1.15.2

Parameters

name

the name of the animation

loop

the loop mode (e.g., play_once, loop, hold)

override

whether this animation should override others

uuid

the unique identifier of the animation

length

the total length of the animation in seconds

blendWeight

the optional numeric or Molang blend weight; null defaults to one

animators

a map of animators, keyed by the UUID of the bone group they affect

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
Supplies model loading state and blend weight while converting animation keyframes.

Functions

Link copied to clipboard
@NotNull
open fun animators(): @NotNull Map<String, ModelAnimator>
Returns the map of animators for this animation.
Link copied to clipboard
abstract fun equals(p: Any): Boolean
Link copied to clipboard
abstract fun hashCode(): Int
Link copied to clipboard
@NotNull
open fun loop(): AnimationIterator.Type
Returns the loop mode of the animation.
Link copied to clipboard
open fun tickTime(): Float
Returns the animation length rounded to the nearest 50 ms Minecraft tick.
Link copied to clipboard
@NotNull
open fun toBlueprint(@NotNull context: @NotNull ModelLoadContext, @NotNull elements: @NotNull List<BlueprintElement>): @NotNull BlueprintAnimation
Converts this raw animation data into a processed BlueprintAnimation.
Link copied to clipboard
abstract fun toString(): String