DefaultAnimations
GeckoLib provides numerous built-in AnimationControllers for common animations.
Overview
GeckoLib holds a collection of default animation utilities for developers to use in the DefaultAnimations class.
This class contains both pre-built AnimationControllers and RawAnimation instances for commonly used animations.
It is strongly recommended to use the pre-built AnimationControllers instead of manually creating controllers whenever possible.
Usage
To use DefaultAnimations built-in controllers, you simply call one of the static methods when registering your controllers in your animatable.
@Override
public void registerControllers(AnimatableManager.ControllerRegistrar controllers) {
controllers.add(DefaultAnimations.genericWalkIdleController());
}
If you do not want to use a pre-built controller, you are still encouraged to use the pre-built RawAnimation instances in your own controller.
Animation Names
Because DefaultAnimations pre-builds the RawAnimation instances for you, it expects that you have used proper animation
naming conventions when creating your animation JSON files.
Below are some example expected animation names. More can be found in the DefaultAnimations class.
misc.idlemisc.diemisc.spawnmove.walkmove.runmove.flyattack.swingattack.biteattack.shoot