Class ArmatureControl

java.lang.Object
net.ixdarklord.coolcatcanvas.api.armature.ArmatureControl

public final class ArmatureControl extends Object
Animating armatures from the server: everyone who can see the entity, block or held item sees the same thing. Each call is one small packet to the players tracking it (and to the entity itself if it is a player); players whose client lacks CoolCatLib are skipped. Called on the client, it acts on that client alone.
ArmatureControl.play(golem, "action", Motion.once("slam"));           // a one-off on a layer
ArmatureControl.setVariable(golem, "v.rage", 0.8);                    // read by Molang in the clips
ArmatureControl.play(level, pos, Motion.once("open"));                // a block entity, on its base layer
ArmatureControl.playHeld(player, InteractionHand.MAIN_HAND, "base", Motion.once("swing"));
These are moments, not state: someone who comes into range later doesn't see a clip that started before. Keep lasting state (a mob being angry, a chest being open) in synced data, and have a layer's driver play from it.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The layer used when none is named, as on the client's Animator.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    play(net.minecraft.world.entity.Entity entity, String layer, Motion motion)
     
    static void
    play(net.minecraft.world.entity.Entity entity, Motion motion)
     
    static void
    play(net.minecraft.world.level.block.entity.BlockEntity blockEntity, String layer, Motion motion)
     
    static void
    play(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, String layer, Motion motion)
     
    static void
    play(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, Motion motion)
     
    static void
    playHeld(net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.InteractionHand hand, String layer, Motion motion)
    Plays on the animator of the stack in an entity's hand (as drawn in that hand, in slots, and in first person).
    static void
    setHeldVariable(net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.InteractionHand hand, String variable, double value)
     
    static void
    setVariable(net.minecraft.world.entity.Entity entity, String variable, double value)
    Sets a Molang variable ("v.name") the entity's clips can read.
    static void
    setVariable(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, String variable, double value)
     
    static void
    stop(net.minecraft.world.entity.Entity entity, String layer)
    Blends a layer back to its driver, or to rest, over its motion's fade time.
    static void
    stop(net.minecraft.world.entity.Entity entity, String layer, float fadeSeconds)
     
    static void
    stop(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, String layer, float fadeSeconds)
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • BASE_LAYER

      public static final String BASE_LAYER
      The layer used when none is named, as on the client's Animator.
      See Also:
  • Method Details

    • play

      public static void play(net.minecraft.world.entity.Entity entity, Motion motion)
    • play

      public static void play(net.minecraft.world.entity.Entity entity, String layer, Motion motion)
    • stop

      public static void stop(net.minecraft.world.entity.Entity entity, String layer)
      Blends a layer back to its driver, or to rest, over its motion's fade time.
    • stop

      public static void stop(net.minecraft.world.entity.Entity entity, String layer, float fadeSeconds)
    • setVariable

      public static void setVariable(net.minecraft.world.entity.Entity entity, String variable, double value)
      Sets a Molang variable ("v.name") the entity's clips can read.
    • play

      public static void play(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, Motion motion)
    • play

      public static void play(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, String layer, Motion motion)
    • play

      public static void play(net.minecraft.world.level.block.entity.BlockEntity blockEntity, String layer, Motion motion)
    • stop

      public static void stop(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, String layer, float fadeSeconds)
    • setVariable

      public static void setVariable(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, String variable, double value)
    • playHeld

      public static void playHeld(net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.InteractionHand hand, String layer, Motion motion)
      Plays on the animator of the stack in an entity's hand (as drawn in that hand, in slots, and in first person).
    • setHeldVariable

      public static void setHeldVariable(net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.InteractionHand hand, String variable, double value)