• 1

    posted a message on Add Custom Background Music
    Thanks for the suggestions. Yeah, I could certainly add in how to put music in the Nether, menu and things like that, it's pretty straightforward. And I think I'll just try and make a video sometime this week.

    As for your first question, yes you can essentially "prevent" the default music from playing. If you name some of your music files the same as the default minecraft ones (hal1, hal2, hal3, hal4, calm1, calm2, calm3, piano1, piano2, piano3, nuance1, nuance2) then in the sounds.json file, you would add "replace": true, so it would look like this:

            "music.game": {
                    "category": "music",
                    "replace": true,
                    "sounds": [
                            {
                                    "name": "music/game/hal1",
                                    "stream": true
                            },
                            {
                                    "name": "music/game/hal2",
                                    "replace": true,
                                    "stream": true
                            },
                            {
                                    "name": "music/game/hal3",
                                    "stream": true
                            },
                            {
                                    "name": "music/game/hal4",
                                    "stream": true
                            },
                            {
                                    "name": "music/game/piano1",
                                    "stream": true
                            }
             ]
    }


    .... and so on and so forth. This would attempt to replace all the files listed in that series, so if you had some you wanted to add outside of the files you're replacing, it'd probably be best to create a new "music.game" list that doesn't include the replace tag, at least that's what I would imagine.

    That should replace the original sound file with your sound file. I've done that with the door_open and door_close sounds because I prefer the older non-squeaky versions, and I imagine it would work the same with the music files.

    As for your second question, yes! There is "replace" as I mentioned just above, but there is also a weight. You can see the options available here from the wiki and/or here from reddit. It also states that the stream function is recommended if the file is longer than a few seconds to avoid lag.
    Posted in: Resource Pack Help
  • 7

    posted a message on Add Custom Background Music
    How To Add Custom Background Music To Minecraft



    Hello! This post is aimed at helping you add custom background music to your minecraft experience. Note that this is not replacing music files, as has been the traditional method of doing it, but instead, adding your own music to play in random rotation with the default minecraft music. I searched quite a bit and found fractured methods of replacing files and adding in custom sounds to use with command blocks, but was unable to find a clear and straightforward method of adding in custom background music without replacing files (and being limited to those amount that are included with minecraft). Therefore, I decided to make this in the hopes I can help someone else who also enjoys customizing their background music experience. I wasn't totally sure where to post this, but since it has to do with resource packs, I decided to put it here. If it's better suited elsewhere, please move as appropriate. 


If there’s enough desire/if this text tutorial is too confusing, I can certainly make a video, too.

    Tutorial:

    Things you will need:

    - Minecraft 1.7.9 (unsure if this works in prior versions, as this is the version I’m using)
    - Access to http://www.jsoneditoronline.org and a text editing application (notepad/textedit, etc)
    - Music files in .ogg (or access to online converter/audacity, etc)


    Part One: Get Your Stuff Together

    Step 1) Find your music files you wish to add as background music. Check the file type: if they are .ogg files, perfect, skip to step 3! If not, there’s the extra step of converting them.

    Step 2) Converting your files to .ogg can be done in a few different ways. If you have a lot of files you want to convert, I highly recommend using Audacity (http://audacity.sourceforge.net). It’s free and works great for batch converting. However, if you don’t wish to use it (or only have a couple you need to convert), there are many free online audio converters. Those can be found with a simple google search (or here http://audio.online-.../convert-to-ogg).

    To convert your files using Audacity, first download and open it. Then, go to File->Import->Audio. You can then select multiple files (by using shift) and when you are done selecting the files you wish to convert, click Open. Audacity will take some time importing your files. Once it is finished, go to File->Export Multiple (if only exporting one file, simply choose export). In the box that comes up, under "Export format" select "Ogg Vorbis Files." Then click on Options and you'll see a slider. Drag it so the number in the middle shows a 2 or a 3. This is done to reduce the file size of the converted audio, and there is little to no noticeable difference in the exported audio. Then click OK.


    Lastly, click Export and you will be prompted to edit the Metadata of the files you are exporting. You can ignore this or fill it out, that is up to you. Either way, you will need to click OK for each file. Once you have gone through all the files, Audacity will export them which may take awhile depending on how many you selected.

    If you are using an online converter, simply select the file you wish to convert and make sure you have .OGG selected as the output. For the website I linked, select "Choose File" and pick the file you wish to convert. Then simply select Convert File.
    Note: if you have WAV or AIFF files or any other audio file that has a large file size, I highly recommend you use Audacity as it will take quite awhile to upload the large files.

    Once you have your files converted, you can move onto step 3.

    Step 3) First off, let’s rename the files to something a bit more simple. Rename the files so the filename is only one word (or so it contains no spaces). It could be as simple as “mcbg1” or “minecraftmusic1” or whatever you want, just as long as there are no spaces.

    Step 4) Now create a folder called “My Resource Pack” or whatever you want to call it. Inside that folder, create another folder called “assets” inside of which you will make another folder called “minecraft” and then inside of that folder make the folder called “sounds” and inside of that folder make the folder called “music” and finally (after all of the folder-ception) make a folder called “game”




    Step 5) Drag all of your .ogg sound files you want as background music into that last folder you named “game.”

    Step 6) Navigate back to your minecraft folder. You can do this if you have the newest launcher by opening minecraft, clicking on the button “Edit Profile” then clicking on “Open Game Dir”

    Step 7) In your minecraft folder, navigate to the folder called “resourcepacks.” Now drag the folder-ception thing you made in step 4 called “My Resource Pack” into that folder.

    Step 8) Now things might start to get a bit confusing. Inside of “My Resource Pack” you will want to put a file called “pack.mcmeta”. This is so the game can recognize your resource pack and have it be selectable in game. Open your text editing application and copy/paste this into it:


    {
       "pack":{
    	  "pack_format":1,
    	  "description":"My Resource Pack"
       }
    }


    Then save it as “pack” and make the file extension .mcmeta after the file is saved. Make sure this is inside of your “My Resource Pack” folder and not inside the “assets” folder. You can change the text in the code that says “My Resource Pack” to say anything you want.



    Part Two: Make Your Music Play

    Step 1) So here we get more confusing. In order for Minecraft to recognize your .ogg files and play them in game, you will need to create a file called “sounds.json” which will be placed inside the assets/minecraft folder, just outside of the “sounds” folder. To do this, open the website http://www.jsoneditoronline.org and you’ll see a bunch of text up there. Hit the “clear” button on the top right side of the page. I suggest using this website because it will show you if there are errors and it keeps the formatting nice.

    Step 2) Now to make the JSON code. For your convenience, it is located here and you can basically just copy/paste it into the editor in your web browser. However, notice that the first and last curly bracket may already be in the editor, so if you receive an error, make sure there isn’t a duplicate set of curly brackets. Note that when you have an open curly bracket, you must have a closed curly bracket as well to end the section.



    {
        "music.game": {
    	    "category": "music",
    	    "sounds": [
    		    {
    			    "name": "music/game/FILENAME",
    			    "stream": true
    		    },
    		    {
    			    "name": "music/game/FILENAME",
    			    "stream": true
    		    },
    		    {
    			    "name": "music/game/FILENAME",
    			    "stream": true
    		    }
    	    ]
        }
    }



    Step 3) Now, check for any duplicate brackets or anything. If there is an error, there will be a red X on the left side of the editor. At this point, if you’re error free, you can continue.

    Step 4) Rename where it says “FILENAME” in the code to the names of your music files that are located in your music/game folder. However, do not add the file extension. I do not know if it will work if you do or not, but I mirrored this off of the file that Minecraft uses to access it’s own sound and music files.

    Step 5) If you have less than three files to add, you can delete extra sets of


    		    {
    			    "name": "music/game/FILENAME",
    			    "stream": true
    		    }


    which may or may not have a comma after the last curly bracket.
    Important! The comma located at the end of the curly bracket can cause an error if there is a comma and it is the last file listed. If it is the last file listed, delete the comma after the curly bracket. If you have more than three files you wish to add, copy and paste the above code, however make sure you add a comma after the last curly bracket. Think of it like a list that is separated by commas. You wouldn’t have a comma after the last item in the list.

    Step 6) Finished? If so, awesome! Now check again for any errors, and if you are error free, click the “save” button in the top right corner of the page. It will download the JSON file you just made. Locate it and rename it to “sounds.json”.

    Step 7) Navigate back to your My Resource Pack/assets/minecraft folder and put your sounds.json file in there, so it is outside of the “sounds” folder, but inside of the minecraft folder. For clarity, your folder structure should look like this.







    Part 3: Enjoying

    Step 1) Open up your minecraft game and go into options. Click resource packs, locate your resource pack, and click on it to add it to the right column called Selected Resource Packs. Then click done.
    Step 2) Start up your game and play! Note that you may not notice the new music immediately because it will play randomly. If you want to make sure it worked and was added in, you can load a world, run around for a minute and wait for music to play. If it isn’t your new music, save and quit, then reload and repeat until you hear your music. Otherwise, just play and enjoy like normal!


    I hope that this tutorial has been helpful and as clear as a text tutorial can be. If you have any questions or if something is unclear, please let me know and I’ll do what I can to help you out!


    Downloads:
    Zipped Resource Pack folder structure - http://goo.gl/E5gVmz
    pack.mcmeta - http://goo.gl/1UAIBH
    sounds.json - http://goo.gl/HWTe2l
    Posted in: Resource Pack Help
  • To post a comment, please or register a new account.