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 all, I have a sounds.json file that looks like this:

 

{
    "teleport_whoosh" : {"category": "block", "sounds": [{"name":"teleport_whoosh","stream":"false"]}
}

 

It is placed inside my assets/rftools/sounds folder.

 

In code I try to play the sound like this:

 

        worldObj.playSoundAtEntity(teleportingPlayer, RFTools.MODID+":teleport_whoosh", 1.0f, 1.0f);

 

But I get this error in the log and no sound:

 

[07:59:50] [Client thread/WARN]: Unable to play unknown soundEvent: rftools:teleport_whoosh

 

I also tried without RFTools.MODID+":" but that doesn't work either.

 

What am I missing?

 

Hi

 

An example from one of my mods

 

resourceLocation = new ResourceLocation("speedytoolsmod:complex.boundarygrab");

 

sound file

 

resources/assets/speedytoolsmod/sounds/complex/boundarygrabquiet.ogg

 

in the json:

{

  "complex.boundarygrab": {"category": "player", "sounds": ["complex/boundarygrabquiet"]}

}

 

Your json looks a bit different to mine, perhaps try the simpler format.  The other bits look fine to me.

 

-TGG

 

PS the json file should be

resources/assets/speedytoolsmod/sounds.json

not

resources/assets/speedytoolsmod/sounds/sounds.json

 

perhaps that's the reason...

 

  • Author

Thanks! Your suggestions fixed it. I misinterpreted this tutorial (http://www.minecraftforge.net/wiki/MrGReapers_tutorials/1.7.2_sound_tutorial) when it said:

 

n your dev enviroment your resources folder will be in : root\src\main\resources\assets\modid in that modid folder you need to create a "sounds" folder and a sounds.json file

 

So I thought the sounds.json should go inside the sounds folder.

 

It works perfectly now.

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.