Posted January 9, 20197 yr I use SoundEvent registry sound and set category are music, stream true in .json but why can't play it. Ummm if possible i don't need remove original backgound music but i want to add for random with original.
January 9, 20197 yr how did you try to play it? Check out my tutorials here: http://jabelarminecraft.blogspot.com/
January 11, 20197 yr Author Now i can play it thank you for reply this post. How i play it. @SideOnly(Side.CLIENT) @SubscribeEvent public void addSound(PlaySoundEvent event) { if(event.getName().equals("music.game") || event.getName().equals("music.creative")) { Random rand = new Random(); int n = rand.nextInt(2) + 1; if(n == 2) { int m = rand.nextInt(6) + 1; if(m == 1) { event.setResultSound(PositionedSoundRecord.getMusicRecord(Register.mo_ce01)); }else if(m == 2) { event.setResultSound(PositionedSoundRecord.getMusicRecord(Register.mo_ce02)); }else if(m == 3) { event.setResultSound(PositionedSoundRecord.getMusicRecord(Register.mo_ce03)); }else if(m == 4) { event.setResultSound(PositionedSoundRecord.getMusicRecord(Register.mo_ce04)); }else if(m == 5) { event.setResultSound(PositionedSoundRecord.getMusicRecord(Register.mo_ce05)); }else if(m == 6) { event.setResultSound(PositionedSoundRecord.getMusicRecord(Register.mo_ce06)); } } } } Edited January 11, 20197 yr by zlappedx3
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.