You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Event keyframes are special markers in an animation that signal when certain actions should occur. They allow API users to respond to key moments in the animation with custom logic, such as playing sounds, applying effects, or triggering other actions. For example, you might create an event keyframe named impact to indicate when a character lands from a jump. You can then listen for this event using the API and define the custom logic that should execute when the animation reaches that point.
val blueprintManager =AnimatedPaperAPI.blueprintManager
val blueprint = blueprintManager.getBlueprint("my_blueprint") ?:returnval animation = blueprint.getAnimation("jump") ?:return
animation.onEvent("impact") { rig ->// Custom logic for when the impact event occurs// Inflict 5.0 damage to all players in a 10.0 radius.
rig.world.getNearbyEntitiesByType(Player::class.java, rig.location, 10.0)
.forEach { it.damage(5.0) }
}
Event keyframes should only be accessible when plugin mode is enabled, ensuring that this functionality is utilized in the appropriate context.
Activity