Posted May 10, 20187 yr I'm trying to create a custom disk for minecraft. Here is what i did: This is my new item (MyItemDisk) : public static final Item DISK_1 = new MyItemDisk("disk_1", Disks.DISK_1); This is my class MyItemDisk : public class MyItemDisk extends ItemRecord implements IHasModel { //IHasModel is for rendering public MyItemDisk(String name,SoundEvent sound) { super(name,sound); setRegistryName(name); setUnlocalizedName(name+".ctm"); setCreativeTab(CreativeTabs.SEARCH); //Because I have a custom creative tab with all the items that have ".ctm" in their unlocalized names ModItems.ITEMS.add(this); //to register the item } @Override //IHasModel public void registerModels() { Main.proxy.registerItemRenderer(this, 0, "inventory"); } } Here is Disks.DISK_1 (the SoundEvent) : public class Disks { public static final SoundEvent DISK_1 = new SoundEvent(new ResourceLocation("ctm:records.disk_1")).setRegistryName("disk_1"); } And finally I register the SoundEvent : @SubscribeEvent public static void registerSoundEvents(RegistryEvent.Register<SoundEvent> event) { event.getRegistry().register(Disks.DISK_1); } And here is my sounds.json : { "records.disk_1": { "category": "record", "sounds": [ { "name": "records/disk_1", "stream": true } ] } } I checked the other thread that I could found and most of the time, the problem was with a wrong folder name but I don't think that it's my issue, is it ? (ps:the sound is in ogg format in "\src\main\resources\assets\ctm\sounds\records") Here is what my folder looks like : And the error : Quote [14:26:06] [main/WARN] [net.minecraft.client.audio.SoundManager]: Unable to play empty soundEvent: ctm:records.disk_1 Edited May 10, 20187 yr by Cyp86 Solved
May 10, 20187 yr 20 minutes ago, Cyp86 said: "name": "records/disk_1", If I recall correctly a sound name should be prefixed by your modid. "name": "ctm:records/disk_1" 33 minutes ago, Cyp86 said: I checked the other thread that I could found and most of the time, the problem was with a wrong folder name but I don't think that it's my issue, is it ? If the file can't be found the startup log will contain a message that a file at a given resource location could not be found.
May 10, 20187 yr Author Thank's that did work, I didn't understood that it was required in the json too.
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.