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

Hello,

how do you add custom music discs? The old ways don't work anymore thanks to

new sound system.

 

best regards

  • Author

where? I don't find a getrecordresource

 

I used:

 

itsHerobrine = new ItemHDisc("herobrinemod:records.seeherobrine").setUnlocalizedName("seeherobrine").setTextureName("herobrinemod:record_seeherobrine");

  • Author

No.  And it won't work eather since I already have this function in my custom disc class. It has something to do with the sound.json

  • Author

I know that you have to extend the ItemRecord class, but don't you have to make your own Sounds.json file for this work proper?

  • Author

Well I made it

 

1. The sounds.json has to be located in your mods asset folder.

2. You can but the records in yourmodname/sounds/records/

3. You have to add the soundfiles to your sounds.json like this:

 

{
  "itsherobrine": {
    "category": "record",
    "sounds": [
      {
        "name": "sounds/records/itsherobrine",
        "stream": true
      }
    ]
  }
}

 

4. Make your own Record class that extends from ItemRecord (because the constructor is invisible)

5. The name of your record has to be: yourmodname:yourrecordname

  • 4 weeks later...

hey, I know the problem seems to be already solved, however, I thought you have to override   

    
public ResourceLocation getRecordResource(String name)
    {
        return new ResourceLocation(name);
    }

so it leads minecraft to your own folder, i tried to override it in my own class

    
@Override
public ResourceLocation getRecordResource(String name)
    {
        return new ResourceLocation("MyModName:" + name);
    }

 

I'v put the wait.ogg in assets.mymodname.sounds.records and open the class in my modfile with

	public static Item record = new Record("wait");

soooooooooooooooooo, unfortunatly I get an error:

[14:38:24] [Client thread/WARN]: Unable to play unknown soundEvent: mymodname:records.wait

What am I doing wrong?

(I'm pretty new to Java and mc modding so don't cry if i made any horrible mistakes  ;) )

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.