Advertisement
jayhillx

sea otter animations

Apr 9th, 2024
1,192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.91 KB | None | 0 0
  1. (in SeaOtterModel class)
  2.     public void setupAnim(T entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) {
  3.         this.root().getAllParts().forEach(ModelPart::resetPose);
  4.         this.head.xRot = headPitch * 0.017453292F;
  5.         this.head.yRot = netHeadYaw * 0.017453292F;
  6.  
  7.         if (entity.isInWaterOrBubble()) {
  8.             this.animateWalk(SeaOtterAnimation.SEA_OTTER_SWIMMING, limbSwing, limbSwingAmount, 10.0F, 8.5F);
  9.         }
  10.  
  11.         this.animate(entity.idleAnimationState, SeaOtterAnimation.SEA_OTTER_IDLE, ageInTicks);
  12.     }
  13.    
  14. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  15. (in SeaOtter entity class)
  16.  
  17.     public void tick() {
  18.         super.tick();
  19.         if (this.level().isClientSide()) {
  20.             this.idleAnimationState.animateWhen(this.isInWaterOrBubble() && !this.walkAnimation.isMoving(), this.tickCount);
  21.         }
  22.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement