Posted August 22, 201312 yr Hello guys may i ask if my code is write about custom background music in custom in custom dimension . Id try many time to check but i never succeeded hopefully someone might help me with thes heres my SoundLoader class public class MHFSoundEvents { private final ArrayList<Object> music = Lists.newArrayList(); @ForgeSubscribe public void onSound(SoundLoadEvent event) { // You add them the same way as you add blocks. event.manager.addSound("monsterhunter:kirin/say1.ogg"); event.manager.addSound("monsterhunter:kirin/say2.ogg"); event.manager.addSound("monsterhunter:kirin/hurt1.ogg"); // Music Theme } public void onSoundLoadEvent(SoundLoadEvent event, URL URL) { music.add(new SoundPoolEntry("monsterhunter:MHFMainTheme1.ogg", URL)); // URL can be anything: point to a file, point to something in your classpath, etc. music.add(new SoundPoolEntry("monsterhunter:MHFMainTheme2.ogg", URL)); // URL can be anything: point to a file, point to something in your classpath, etc. music.add(new SoundPoolEntry("monsterhunter:MHFMainTheme3.ogg", URL)); // URL can be anything: point to a file, point to something in your classpath, etc. } public void onBackgroundMusic(PlayBackgroundMusicEvent event, Random rand) { Minecraft mc = Minecraft.getMinecraft(); if (mc.thePlayer.dimension == 3) { event.result = (SoundPoolEntry) music.get(rand.nextInt(music.size())); } }
August 22, 201312 yr Don't be impatient mate, europeans are still at work while americans are waking up now A few hours and there will be more activity and your thread will be responded too if anyone has a proper answer If you guys dont get it.. then well ya.. try harder...
August 22, 201312 yr public void onSoundLoadEvent(SoundLoadEvent event, URL URL) ... public void onBackgroundMusic(PlayBackgroundMusicEvent event, Random rand) Do you call those methods yourself ?
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.