Posted May 21, 20169 yr Hi, I'm wondering how I can let a entity, for example a falling block play a sound. So when the block get's removed and replaced with the falling entity a custom falling sound will be played until the entity reaches the ground. It would also be nice to have the sound quieter when the distance between the player and the block is larger and the sound. And is there a method for letting the sound play later when the player is farer away like in RL? Just to mention, I have the Falling entity instance, but I don't have access to any player... In I think 1.8.9 was it, I did it that way: entityFallingBlock.worldObj.playSoundAtEntity(entityFallingBlock, ModSounds.FALLINING_ROCK_SHORT, .8f, .5f); I'm now using 1.9.4. Thx in advance. Bektor Developer of Primeval Forest.
May 22, 20169 yr Author You have to register a SoundEvent for every one of your sounds. This registration works just like for Blocks or Items, you create a new SoundEvent and register it using GameRegistry.register . The method you were using does not exist anymore now, but you can use Entity#playSound . Ok, thx. Developer of Primeval Forest.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.