Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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.

  • 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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.