Posted May 21, 201411 yr Hello, how do you add custom music discs? The old ways don't work anymore thanks to new sound system. best regards
May 21, 201411 yr Author where? I don't find a getrecordresource I used: itsHerobrine = new ItemHDisc("herobrinemod:records.seeherobrine").setUnlocalizedName("seeherobrine").setTextureName("herobrinemod:record_seeherobrine");
May 21, 201411 yr 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
May 22, 201411 yr Look at ItemRecord.class as Diesieben suggests. It has methods to do what you want when overridden, -S- (if I helped, please click Thank and applaud) http://6upnqa.dm2301.livefilestore.com/y2mtf-vG7Tqq1TiiVpIm53KWj7294NDPoHfSHHb4PzZiMAUfRCfK0UY0MwOu7Q3zTBNVTKqWjr2-xgBfFRpQT5p-QivtvknPpoABMNUw9br9WuZcBFkjePhnAbW500gVm-P/sequiturian.png[/img]
May 22, 201411 yr 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?
May 23, 201411 yr 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
June 20, 201411 yr 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.