Posted July 12, 201411 yr 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
July 12, 201411 yr Author also i found the source but i dont really understand it with all the functions they use
July 13, 201411 yr 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 ^^
September 4, 201411 yr 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.