Jump to content
  • Home
  • Files
  • Docs
  • Merch
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • 1.6.2 PlayBackGroundMusicEvent In a Custom Dimension
1.13 Update Notes for Mod Creators
Sign in to follow this  
Followers 0
Heltrato

1.6.2 PlayBackGroundMusicEvent In a Custom Dimension

By Heltrato, August 22, 2013 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

Heltrato    1

Heltrato

Heltrato    1

  • Diamond Finder
  • Heltrato
  • Members
  • 1
  • 258 posts
Posted August 22, 2013

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()));
        }
    }
    




 

  • Quote

Share this post


Link to post
Share on other sites

Heltrato    1

Heltrato

Heltrato    1

  • Diamond Finder
  • Heltrato
  • Members
  • 1
  • 258 posts
Posted August 22, 2013

bump ?

  • Quote

Share this post


Link to post
Share on other sites

Mazetar    271

Mazetar

Mazetar    271

  • World Shaper
  • Mazetar
  • Forge Modder
  • 271
  • 1343 posts
Posted August 22, 2013

Don't be impatient mate, europeans are still at work while americans are waking up now :P

A few hours and there will be more activity and your thread will be responded too if anyone has a proper answer :)

  • Quote

Share this post


Link to post
Share on other sites

GotoLink    381

GotoLink

GotoLink    381

  • World Shaper
  • GotoLink
  • Members
  • 381
  • 2012 posts
Posted August 22, 2013

public void onSoundLoadEvent(SoundLoadEvent event, URL URL)
...
public void onBackgroundMusic(PlayBackgroundMusicEvent event, Random rand)

Do you call those methods yourself ?

  • Quote

Share this post


Link to post
Share on other sites

Heltrato    1

Heltrato

Heltrato    1

  • Diamond Finder
  • Heltrato
  • Members
  • 1
  • 258 posts
Posted August 22, 2013

sorry man but what ?

  • Quote

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Rixxaw
      Minecraft Core Issue/Forge Issue???

      By Rixxaw · Posted 4 minutes ago

      Download the Twitch App, and go to "Mods" then select a modpack from the list of packs there.  Assuming you are attempting to "Create" your own modpack.  There are thousands of modpacks already created and it is very likely you will find one with the mods you want.  If  Not, look for a Vanilla+ pack, and then unlock the profile, and add whatever mods you want.  The App will make sure they are of the right version and what not.  Thus you essentially create your own pack that way in a sense.
    • Iceo
      1.12.2 Server Crash with Applied Energistics 2

      By Iceo · Posted 5 minutes ago

      I dont know what you mean by OpenJDK don't you use that for developing mods?
    • Iceo
      1.12.2 Server Crash with Applied Energistics 2

      By Iceo · Posted 28 minutes ago

      I have no idea what you mean. I just run it using server.pro using a tutorial I found and I get this crash. I run it fine on client though.
    • DaemonUmbra
      1.12.2 Server Crash with Applied Energistics 2

      By DaemonUmbra · Posted 36 minutes ago

      Do you get this issue running OpenJDK?
    • DaemonUmbra
      Minecraft Forge Mods Won't Load for Me

      By DaemonUmbra · Posted 39 minutes ago

      Modded worlds are almost never portable between versions, as it requires modders to publish their mod in both versions as well as include code to upgrade old save data
  • Topics

    • Aaronade
      2
      Minecraft Core Issue/Forge Issue???

      By Aaronade
      Started 4 hours ago

    • Iceo
      3
      1.12.2 Server Crash with Applied Energistics 2

      By Iceo
      Started 41 minutes ago

    • runescaper
      7
      Minecraft Forge Mods Won't Load for Me

      By runescaper
      Started 1 hour ago

    • catcube
      6
      is there a way to get alpha Textures, sounds and old lighting into MC 1.13.2? (Hire a modder?)

      By catcube
      Started November 27, 2018

    • Aeriona
      2
      Forge or mods not working

      By Aeriona
      Started 2 hours ago

  • Who's Online (See full list)

    • Lordyammer
    • Choco
    • Iceo
    • Rixxaw
    • Elrol_Arrowsend
    • ErYizus
    • Nuparu00
    • enduringgamer
    • saxon564
    • imacatlolol
    • Pi Man
    • abesterre
    • Pyre540
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • 1.6.2 PlayBackGroundMusicEvent In a Custom Dimension
  • Theme
  • Contact Us
  • Discord

Copyright © 2019 ForgeDevelopment LLC · Ads by Curse Powered by Invision Community