Jump to content

how would i go about adding more records into minecraft...


classlessrook32

Recommended Posts

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 ^^

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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