Hi!
I want to slowdown the while loop because it's spamming the playSound and causing the game to crash
i saw that Thread.sleep() is freezing the whole game, so i guess i should count ticks but i have no idea how to do it.
Here's my code (The LOW_HEALTH_SOUND is 4.2s long)
@SubscribeEvent
public void LivingDamageEvent(LivingDamageEvent event) {
Entity entity = event.getEntity();
World worldIn = event.getEntity().world;
if(entity instanceof EntityPlayer) {
float