GeckoLib

GeckoLib

146M Downloads

[1.20.1] Entities are twitching time to time (BUG)

Feroov opened this issue ยท 4 comments

commented

(Btw it doesn't allow me to add bug label on issues) I noticed the bug from the 4.2 and 4.2.1 versions of 1.20 but didn't have this issue prior to 1.20, I've already mentioned this issue on the discord server but I'll create an issue here. Here is what the bug looks like:

Alt Text

The code is self is simple, I use constants for my animations, here is one of the examples:

    public void registerControllers(AnimatableManager.ControllerRegistrar controllerRegistrar)
    {
        controllerRegistrar.add(new AnimationController<>(this, "livingController", 0, event ->
        {
            if (isAttacking()) return event.setAndContinue(AnimationConstants.ATTACK);
            if (isAggressive() && this.walkAnimation.speed() > 0.35F && this.onGround() && !this.swinging) return event.setAndContinue(AnimationConstants.RUN);
            if (event.isMoving() || this.swinging) return event.setAndContinue(AnimationConstants.WALK);
            return event.setAndContinue(AnimationConstants.IDLE);
        }));
    }
commented

I'm gonna try to document more this case cause i have the same issue.

I try these things:

  • Changing the entity model.
  • Removing layers from the entity renderer class.
  • Removing my animationController from the entity class.
  • Removing all my entity IA apart from a lookingPlayerGoal.

In all cases the twitching still continues when testing.

Good to know, if i remove the customAnimation handling the head movement in the entity model class the head twitching stop for me.

It seems somehow world related, i don't have the bug in a new world and sometimes later the issue starts and dont stop.

Last but not least, the issue is happening only if at least two entities of the same type are present in the world as you can see there:

2023-07-23.21-56-00.mp4

And it seems the "head twitching" is the first entity switching between his head position and the head position of the others entities.

I think it's maybe related so i give this information too, when handling particles with renderFinal inside my entity renderer i have more particles when the two entities are there and the head twitching bugs as started in the world.

I have no issue with giving full access at my code for now, so here it is in case it can help:
https://github.com/Goldocelot/Wildlife-1.20.1/blob/master/src/main/java/be/goldocelot/wildlife/world/entity/hyena/Hyena.java

commented

But the initial report only has one entity, whereas you seem to be saying it only happens when there's more than one?

commented

As you can see on my video the twitching instantly stop when i kill the other entity and restard when i respawn it so yes for me it happen with at least two entities never with one only.

It would be great to know if it's the same for Feroov, if he is sure it was the only entity or if it could be another one off screen.

commented

The origin of this was excessively high FPS (which you shouldn't be playing on)
I'm closing this as a non-issue for now