#Player Animations
7 messages · Page 1 of 1 (latest)
I have the same issue. Cant find a guide.
But a hint i got is to use blockbench, and somehow
- magically get a player model to rig
- export the animations data
- magically use mixin to replace the use animation
- the method that controls the use animation is in magic path
all the magic part are gaps left to be filled by the lack of documentations
#1231671627209637958 message
Someone said something about a PlayerEntityRenderer class which might suggests something important
Easiest way i just found is
public class PlayerModelMixin<T extends LivingEntity> {
@SuppressWarnings("all")
@Inject(at = @At("TAIL"), method = "setupAnim(Lnet/minecraft/world/entity/LivingEntity;FFFFF)V")
private void setupAnim(T pEntity, float pLimbSwing, float pLimbSwingAmount, float pAgeInTicks, float pNetHeadYaw, float pHeadPitch, CallbackInfo info) {
if (!(pEntity instanceof Player player))
return;
PlayerModel<T> model = (PlayerModel<T>) (Object) this;
if (!Minecraft.getInstance().options.getCameraType().isFirstPerson()) {
if (player.getItemInHand(InteractionHand.MAIN_HAND).is(ItemRegistrar.MJOLNIR.get())) {
model.leftArm.zRot = (float) Math.toRadians(90.0F);
}
}
}
}```
As a client mixin
I found something related to player animations API, which was also implemented by popular mod kelvins better animations
https://github.com/KosmX/fabricPlayerAnimatorExample
Anyone knows if it will create compatibility issues between 2 mods that uses the same library?