classlessrook32 Posted July 12, 2014 Share Posted July 12, 2014 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 Quote Link to comment Share on other sites More sharing options...
classlessrook32 Posted July 12, 2014 Author Share Posted July 12, 2014 also i found the source but i dont really understand it with all the functions they use Quote Link to comment Share on other sites More sharing options...
daafganggdg Posted July 13, 2014 Share Posted July 13, 2014 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 ^^ Quote Link to comment Share on other sites More sharing options...
UntouchedWagons Posted September 4, 2014 Share Posted September 4, 2014 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. Quote I like trains. Link to comment Share on other sites More sharing options...
Recommended Posts
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.