Started by
buzzer
on
Topic category: Troubleshooting, bugs, and solutions
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.
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.
That was it! Thank you
Please see our wiki where we explain many things: https://mcreator.net/wiki/developing-multiplayer-compatible-mods