-
Notifications
You must be signed in to change notification settings - Fork 0
Trigger Animations
liopyu edited this page Aug 30, 2025
·
6 revisions
These methods are available on the player object and allow scripters to trigger animations anywhere directly off the server player.
Used to trigger animations off a server player. This method can be called from any server player object.
Example Usage:
event.player.triggerAnimation("animationjs:waving")- animationName: ResourceLocation - The name of the animation specified in the JSON.
Used to trigger animations off a server player with the option for animations to overlap themselves when played.
Example Usage:
event.player.triggerAnimation("animationjs:waving", true)- animationName: ResourceLocation - The name of the animation specified in the JSON.
- canOverlapSelf: Boolean - Whether the animation can overlap itself if it's already playing.
Used to trigger animations off the server player with customizable animation data.
Example Usage:
event.player.triggerAnimation("animationjs:waving", 1, "linear", true, false);- animationID: ResourceLocation - The name of the animation specified in the JSON.
- transitionLength: int - Duration of the transition length in milliseconds.
-
easeID: String - ID of the easing function to use for animation easing from the
Easeclass. - firstPersonEnabled: Boolean - Whether the animation should be visible in first-person view.
- important: Boolean - Whether the animation is important and should override other animations.
- Description: Used to trigger animations off a server player with part control and modifiers.
-
Example Usage:
event.player.triggerAnimation("animationjs:smith", 1, "linear", true, false, ["playeranimatorapi:headposboundcamera"], parts => { parts.leftArm.setEnabled(false); });
-
Parameters:
-
animationID: ResourceLocation - The name of the animation specified in the JSON. -
transitionLength: int - Duration of the transition length in milliseconds. -
easeID: String - ID of the easing function to use for animation easing from thedev.kosmx.playerAnim.core.util.Easeclass. -
firstPersonEnabled: boolean - Whether the animation should be visible in first-person view. -
important: boolean - Whether the animation is important and should override other animations. -
modifiers: List - List of modifiers to apply to the animation. -
partsConsumer: Consumer - Consumer to modify player parts such as part visibility, rotation, etc.
-
- Description: Stops a specified animation for the player.
-
Parameters:
-
animationID: ResourceLocation - The name of the animation to stop.
-
-
Example:
event.player.stopAnimation("animationjs:walk");