Posted July 9, 20178 yr Hello, I have been trying to get a custom sound to work for a while now, I thought I did everything right but the sound will not play in-game. Here is my handler Spoiler package handlers; import net.minecraft.util.ResourceLocation; import net.minecraft.util.SoundEvent; import noahsmod.main.MyMod; public class CustomSoundHandler { private static int size = 0; public static SoundEvent NUKE_EXPLODE; public static void init() { size = SoundEvent.REGISTRY.getKeys().size(); NUKE_EXPLODE = register("block.nuke_explode"); } Spoiler public static SoundEvent register(String name) { ResourceLocation location = new ResourceLocation("nm", name); SoundEvent e = new SoundEvent(location); SoundEvent.REGISTRY.register(size, location, e); size++; System.out.print("REGISTERED"); return e; } } Here is my Sounds.json: Spoiler { "block.nuke_explode": { "category": "block", "subtitle": "block.nuke_explode", "sounds": [ { "name": "nm:block/nuke_explode", "stream": true } ] } } My sound is located at : Workspace\src\main\resources\assets\nm\sounds\block Any help is appreciated, thanks!
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.