Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
Model Engine 4 Model Engine 4
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 108
    • Issues 108
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • MythicCraft
  • Model Engine 4Model Engine 4
  • Wiki
    • Api
    • Basic
  • Play Stop Animation

Last edited by Ticxo Sep 29, 2023
Page history

Play Stop Animation

Playing an animation

// Get a hold of the ActiveModel you want to modify
ActiveModel model = ...
// Get the model's AnimationHandler
AnimationHandler handler = model.getAnimationHandler();
// Play an animation 
handler.playAnimation("attack", 0.3, 0.3, 1, true);

Stopping an animation with transition

ActiveModel model = ...
AnimationHandler handler = model.getAnimationHandler();
// Stop an animation. The model will transition out of the animation smoothly 
handler.stopAnimation("eating");

Stopping an animation immediately

ActiveModel model = ...
AnimationHandler handler = model.getAnimationHandler();
// Stop an animation. The model will snap right out of the animation 
handler.forceStopAnimation("eating");

Using specific animation handler method

ActiveModel model = ...
AnimationHandler handler = model.getAnimationHandler();
if(handler instanceof IStateMachineHandler stateMachineHandler) {
	// Using special stop animation method from IStateMachineHandler
	stateMachineHandler.stopAnimation(1, "eating");
}else {
	// Fallback animation stopping with default method
	handler.stopAnimation("eating");
}
Clone repository
Home
FAQ / Common Issues
Commands & Permissions
Configuration

Modeling
  • Creating a Model
    • Hitbox & Eye Height
    • Shadow
  • Bone Behaviors
    • Player Limbs
  • Animating a Model
  • Importing a Model
  • Scriptable Keyframes
  • Optional Tools
MythicMobs
  • Mechanics
  • Conditions
  • Targeters
Citizens (R4.0.4)
  • Trait
  • Commands & Permissions

API
  • Basic
    • Apply / Remove Model
    • Play / Stop Animation
    • Configure Bone Behaviors
    • Mounting / Dismounting Model
    • Per-Player Model
    • Events
  • Advanced
    • Custom Base Entity
    • Custom Mount Controller
    • Custom Importer
    • Custom Bone Behaviors
    • Custom Script Reader
    • Custom Timeline
    • Custom Animation Handler
    • Custom Render Type

Technical
  • Terminology
  • Animation Systems
  • Mount Controllers
Promotional Material