You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's not really a library problem, but rather a minecraft problem
I have an animated item that has an inventoryTick method that has the following code in it:
varid = GeoItem.getId(stack);
varanimationController = getAnimatableInstanceCache().getManagerForId(id).getAnimationControllers().get("controller");
varisSprinting = entity.isSprinting();
varisTriggeredSprinting = animationController.isPlayingTriggeredAnimation() && animationName.equals("sprinting");
varactiveStack = ((PlayerEntity) entity).getMainHandStack();
varisActiveStack = activeStack == stack;
varisActiveStackAndSprinting = isSprinting && isActiveStack;
// The animation of an inactive ItemStack must be forced to idleif (isActiveStackAndSprinting && !isTriggeredSprinting) {
animationController.tryTriggerAnimation("sprinting");
} elseif (!isActiveStackAndSprinting && isTriggeredSprinting) {
animationController.tryTriggerAnimation("idle");
animationController.stop();
}
And when I have two items with the same STACK_ANIMATABLE_ID_COMPONENT in my inventory, they behave as follows:
java_2025-02-19_15-18-03-932.mp4
If I try something like this:
if (isActiveStack) {
if (isSprinting && !isTriggeredSprinting) {
animationController.tryTriggerAnimation("sprinting");
} elseif (!isSprinting && isTriggeredSprinting) {
animationController.tryTriggerAnimation("idle");
animationController.stop();
}
}
Then it works as expected, but when switching to an inactive item I'll see it suddenly go from sprinting to idle
java.2025-02-20.04-31-58-909.mp4
Because the sprinting animation wasn't turned off in it earlier
But if I try to turn it off, it will also turn off the animation of the active item, because of the same id
The text was updated successfully, but these errors were encountered:
It's not really a library problem, but rather a minecraft problem
I have an animated item that has an inventoryTick method that has the following code in it:
And when I have two items with the same STACK_ANIMATABLE_ID_COMPONENT in my inventory, they behave as follows:
java_2025-02-19_15-18-03-932.mp4
If I try something like this:
Then it works as expected, but when switching to an inactive item I'll see it suddenly go from sprinting to idle
java.2025-02-20.04-31-58-909.mp4
Because the sprinting animation wasn't turned off in it earlier
But if I try to turn it off, it will also turn off the animation of the active item, because of the same id
The text was updated successfully, but these errors were encountered: