GeckoLib

GeckoLib

146M Downloads

[1.17.x Fabric] Entity animations with sound effects bug if the shouldLoop animation field is set to false

ikerleon02 opened this issue · 6 comments

commented
commented

When an entity animation (haven't checked block or item) is set not to loop (shouldLoop false), it looks like the sound listener is called multiple times per animation. (See gyazo link below)

When an entity is spawned the sound matches perfectly the animation and it is played perfectly. The problem starts when a second entity is spawned near it. When 2+ entities are close together, only one plays the normal sound. The others play the sound multiples times. The entity playing the normal sound changes with time.

As mentioned by Gecko in the discord, it might be the markNeedsReload() method of the controller with the shouldLoop field of the animation set to false.

Other scenarios played:

  • Without markNeedsReload() and the shouldLoop set to true it works as expected
  • With markNeedsReload() and the shouldLoop set to true it works as expected

For further investigation, if needed, I link below the github repository of my mod, currenty using geckolib, as well as the animated entity class.

https://gyazo.com/a9ab82b34692b6d2f715cd12f7e963b2
https://github.com/ikerleon02/TheBirdwatchingMod/tree/1.17.1-fabric/src/main/java/com/ikerleon/birdwmod
https://github.com/ikerleon02/TheBirdwatchingMod/blob/1.17.1-fabric/src/main/java/com/ikerleon/birdwmod/entity/BirdEntity.java

commented

Can you try this on the newest version I just pushed for 1.17.1? 3.0.29

commented
commented

I gave it a try, since i had all setted up, and unfortunately it doesn't work either

commented

Hi @ikerleon02 we did some changes to the core since this, please try on the latest 1.18.1 as 1.17.1 is no longer supported.

commented

@ikerleon02 keyframes got an update in 1.18.1 via a core update, if you can try this in that.