OnEntityTickUpdate possibly running multiple times per tick

Started by buzzer on

Topic category: Troubleshooting, bugs, and solutions

Joined Oct 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
OnEntityTickUpdate possibly running multiple times per tick

I have a procedure for OnEntityTickUpdate to count the number of ticks elapsed until it reaches 140 ticks (7 seconds) and play a sound when it does. Problem is, whenever it reaches 140 ticks, the sounds plays twice, despite resetting the timer before playing the sound. I double checked the code and made sure the procedure wasn't being called somewhere else. The only reason I can think of that this would be happening is if, for some reason, the script is running twice per tick at the same time. I'd post the code, but there's a rule against posting screenshots.

Joined Aug 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If you just play a sound, it…
Sat, 10/12/2024 - 19:39

If you just play a sound, it's going to trigger  clientside  and serverside. All play-sound blocks should be wrapped within a "Is provided world clientside" check or they will double.

Joined Oct 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
That was it! Thank you
Sat, 10/12/2024 - 23:40

That was it! Thank you