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

hey all so i was curious how i would add more records into minecraft i was looking throught the source code for a while and i just couldnt find where the code for records is so thanks for helping and goodbye. -class

So, the class thats used for records is called ItemRecord.

The constructor is protected, so you have to make your own class and extend it from ItemRecord.

You can override:

ResourceLocation getRecordResource(String name)

to change the music, it's NOT the .ogg file I'm pretty sure, but the sounds.json, but there I'm stuck too, on how u do it correctly ^^

  • 1 month later...

So, the class thats used for records is called ItemRecord.

The constructor is protected, so you have to make your own class and extend it from ItemRecord.

You can override:

ResourceLocation getRecordResource(String name)

to change the music, it's NOT the .ogg file I'm pretty sure, but the sounds.json, but there I'm stuck too, on how u do it correctly ^^

 

This is correct. You do something like this:

 

public class MyAwesomeRecord extends ItemRecord
{
    public MyAwesomeRecord()
    {
        super("record_name");
        
    }
    
    @Override
    public ResourceLocation getRecordResource(String name)
    {
        return new ResourceLocation("your-mod-id", "records.whatever");
    }
}

 

Now in your sounds.json file (this file goes in src/main/resources/assets/your-mod-id/) you put something like this:

 

{
    "records.whatever": {
        "category": "record",
        "sounds": [
            {
                "name": "record/file-name-without-extension",
                "stream": true
            }
        ]
    }
}

 

And that's pretty much it.

I like trains.

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.