-
Notifications
You must be signed in to change notification settings - Fork 0
Animation
wjddusrb03 edited this page Mar 29, 2026
·
1 revision
DisplayAPI includes a keyframe-based animation engine with 12 easing functions and 8 preset animations.
Scales between min and max size.
DisplayAPI.animate(display).pulse(0.8f, 1.5f, 30).loop(true).play();
// minScale maxScale ticksRotates 360 degrees on an axis.
DisplayAPI.animate(display).spin(AnimationBuilder.Axis.Y, 40).loop(true).play();
// axis ticks
// Axis options: X, Y, ZMoves up and drops back down.
DisplayAPI.animate(display).bounce(0.3f, 20).loop(true).play();
// height ticksGentle bobbing up and down.
DisplayAPI.animate(display).floating(0.3f, 40).loop(true).play();
// amplitude ticksFades from invisible to visible (TextDisplay only).
DisplayAPI.animate(display).fadeIn(20).play();Fades from visible to invisible (TextDisplay only).
DisplayAPI.animate(display).fadeOut(20).play();Scales from 0 to target size with overshoot effect.
DisplayAPI.animate(display).growIn(1.0f, 20).play();
// targetScale ticksRapid horizontal oscillation with decay.
DisplayAPI.animate(display).shake(0.15f, 20).play();
// intensity ticksFor full control, use the keyframe API:
DisplayAPI.animate(display)
.keyframe(Keyframe.at(0).scale(1f).translation(0, 0, 0))
.keyframe(Keyframe.at(10).scale(1.5f).translation(0, 0.5f, 0))
.keyframe(Keyframe.at(20).scale(1f).translation(0, 0, 0))
.easing(Easing.EASE_IN_OUT)
.loop(true)
.play();Keyframe.at(tick) // Tick position
.scale(float) // Uniform scale
.scale(x, y, z) // Non-uniform scale
.translation(x, y, z) // Position offset
.rotationX(degrees) // X-axis rotation
.rotationY(degrees) // Y-axis rotation
.rotationZ(degrees) // Z-axis rotation
.opacity(int) // Text opacity (0-255)// play() returns a DisplayAnimation controller
DisplayAnimation anim = DisplayAPI.animate(display)
.pulse(0.8f, 1.5f, 30)
.loop(true)
.play();
// Stop later
anim.stop();See Easing-Functions for detailed descriptions of all 12 easing curves.
You can play multiple animations on the same display:
SpawnedDisplay item = DisplayAPI.item(location)
.item(new ItemStack(Material.NETHER_STAR))
.spawn();
// Float + Spin simultaneously
DisplayAPI.animate(item).floating(0.3f, 40).loop(true).play();
DisplayAPI.animate(item).spin(AnimationBuilder.Axis.Y, 60).loop(true).play();