banner



How To Change Sounds In Minecraft Resource Packs

This tutorial will help y'all locate the sound directory, where the sounds for Coffee Edition are stored.

Contents

  • ane Sound directory (after 1.vii.2)
    • one.1 Locating specific sound files
  • 2 Extracting Minecraft Sounds using Node.js
  • iii Extracting Minecraft Sounds using Python
  • 4 Extracting Minecraft Music On Windows (via Windows Subsystem for Linux)
  • 5 Extracting Minecraft Music On Linux
  • half-dozen Extracting Minecraft Music On Mac
  • vii Old sound directory (pre-1.7.ii)
    • 7.1 Legacy sub-folders
  • eight Alert
  • 9 Video tutorials
  • 10 Encounter also

Sound directory (after 1.7.2) [ ]

The sound file for versions afterwards one.7.2 is located in the indexes directory:

1.eight macOS: ~/Library/Awarding Back up/minecraft/assets/indexes/1.8.json

i.11 macOS: ~/Library/Application Support/minecraft/assets/indexes/ane.eleven.json

The sound files in version 1.7.2 (specifically 13w42a) and in a higher place are scattered and hashed into dissimilar folders, which are located in:

  • Windows: %AppData%\.minecraft\assets\objects
  • macOS: ~/Library/Application Support/minecraft/assets/objects
  • Linux: ~/.minecraft/avails/objects

Locating specific sound files [ ]

Find the folder indexes, which is institute under the same assets folder as objects, where the audio files are indexed and logged in the sounds.json file. Select the version you desire and open up the sounds.json file with a program that supports it, such as Notepad. Programs such equally Notepad++ are recommended to help make the file more readable. Once opened, y'all may find something that looks like this:

"sounds/music/card/menu1.ogg": {     "hash": "c157c56846f0e50620f808fecd9d069423dd6c41",     "size": 1744657 },

From this, we tin determine that menu1.ogg is hashed (or labeled) equally c157c56846f0e50620f808fecd9d069423dd6c41. Perform a search in the directory objects under assets and you should notice a file with the same exact cord; this is the file "menu1.ogg", one of the pieces of music that plays on the menu screen. The beginning two letters of the file name ("c1") will match the binder that the file is in likewise; knowing this can help locate specific files faster.

After locating the file, you can test it to make sure it is the correct one past playing information technology with a media role player that is able to play .ogg sound files. If the media player y'all take cannot play the file, try renaming it with ".ogg" at the cease. If this fails too, so information technology either means the media player y'all apply does not have a proper .ogg extension to play the sound, or the file y'all found is non a sound file.

Note: If yous accidentally edit or remove the file from the original directory, the launcher will automatically re-download it again the adjacent time you launch the game. (You must be connected to the Internet when you launch the game. If non, then the sound directory volition not be reset and could potentially lead to errors.)

[ ]

This is probably the simplest style to extract the sound files with orginal effections.

Script 1
                                      one                        var            fs            =            require            (            'fs-extra'            )                          2                                      3                        var            objects            =            require            (            './indexes/1.xvi.json'            ).            objects                          4                                      5                        for            (            var            filePath            in            objects            )            {                          6                                      vii                        if            (            !            /\/(?:sounds)\//            .            examination            (            filePath            ))            continue                          8                        if            (            !            /\/(?:ambient|block|damage|dig|enchant|entity|event|fire|fireworks|item|liquid|minecart|mob|music|notation|portal|random|records|step|title|ui)\//            .            examination            (            filePath            ))            continue                          9                        x                        var            copyPath            =            filePath            .            replace            (            'minecraft/'            ,            './'            )            eleven                        var            hash            =            objects            [            filePath            ].            hash            12                        var            objectPath            =            './objects/'            +            hash            .            substring            (            0            ,            2            )            +            '/'            +            hash            13                        console            .            log            (            objectPath            ,            '->'            ,            copyPath            )            14                        fs            .            copySync            (            objectPath            ,            copyPath            )            15                        }          
Script 2 to run Script 1
                        1                        @            echo            off            two            npm install fs-extra -y            three            node extract-music.js            4                        pause          
  1. Beginning of all, install Node.js onto your computer.
  2. Create a new file within .minecraft/assets called extract-music.js and paste the outset script into it.
  3. Create a new file inside .minecraft/assets called Excerpt.bat and paste the second script into it.
  4. Now y'all can run it by double clicking the Extract.bat file. Information technology volition create a new sounds folder with all the sounds in it.
  • Past default information technology volition extract ane.16 files. To modify the version, go into the extract-music.js file and on the 3rd line, change one.16.json to any version you want (you demand to take actually played the version at least once).
Note

Make sure the file extensions are .js and .bat and non .txt when you rename information technology! In other words, remove your old file extension. You may be warned that changing a file name extension could make the file unusable. However, this really indicates that you have renamed it correctly. Information technology will work if yous continue it .txt as case, only information technology's probably nicer to have information technology for what it is for.

If you are using Microsoft Windows and tin can't see file extensions, for Windows 10, you lot tin turn them on past going to the View menu of the file explorer and checking the cheque box for file proper noun extensions. For Windows below Windows ten, you lot can uncheck "hibernate extensions" in folder settings.

FileExtensions.png

[ ]

                                      1                        import            json            ,            bone            ,            platform            ,            shutil            ,            sys                          ii                                      3                        '''                                      iv                                      Copies sound files from indescript hashed folders to named sorted folders.                          5                                      Yous may demand to alter output path.                          6                        '''                          7                                      viii                        # This section should work on whatever arrangement also                          9                        print            (            "Your OS is "            +            platform            .            system            ())            10                        if            platform            .            organization            ()            ==            "Windows"            :            xi                        MC_ASSETS            =            os            .            path            .            expandvars            (            r            "%APPDATA%/.minecraft/assets"            )            12                        else            :            13                        MC_ASSETS            =            os            .            path            .            expanduser            (            r            "~/.minecraft/assets"            )            xiv                        15                        # Detect the latest installed version of minecraft (choose the concluding element in assets/indexes)            16                        MC_VERSION            =            os            .            listdir            (            MC_ASSETS            +            "/indexes/"            )[            -            1            ]            17                        impress            (            "Your latest installed version of minecraft is "            +            MC_VERSION            [:            -            5            ]            +            "            \north            "            )            eighteen                        xix                        # Change this if you want to put the sound files somewhere else            20                        OUTPUT_PATH            =            os            .            path            .            normpath            (            os            .            path            .            expandvars            (            os            .            path            .            expanduser            (            f            "~/Desktop/MC_Sounds/"            )))            21                        22                        # These are unlikely to change            23                        MC_OBJECT_INDEX            =            f            "            {MC_ASSETS}            /indexes/            {MC_VERSION}            "            24                        MC_OBJECTS_PATH            =            f            "            {MC_ASSETS}            /objects"            25                        MC_SOUNDS            =            r            "minecraft/sounds/"            26                        27                        28                        with            open            (            MC_OBJECT_INDEX            ,            "r"            )            equally            read_file            :            29                        # Parse the JSON file into a dictionary            30                        data            =            json            .            load            (            read_file            )            31                        32                        # Detect each line with MC_SOUNDS prefix, remove the prefix and keep the rest of the path and the hash            33                        sounds            =            {            k            [            len            (            MC_SOUNDS            ):]            :            v            [            "hash"            ]            for            (            grand            ,            v            )            in            information            [            "objects"            ]            .            items            ()            if            one thousand            .            startswith            (            MC_SOUNDS            )}            34                        35                        print            (            "File extraction :"            )            36                        37                        for            fpath            ,            fhash            in            sounds            .            items            ():            38                        # Ensure the paths are expert to go for Windows with properly escaped backslashes in the cord            39                        src_fpath            =            os            .            path            .            normpath            (            f            "            {MC_OBJECTS_PATH}            /            {fhash[:ii]}            /            {fhash}            "            )            twoscore                        dest_fpath            =            bone            .            path            .            normpath            (            f            "            {OUTPUT_PATH}            /sounds/            {fpath}            "            )            41                        42                        # Print current extracted file            43                        impress            (            fpath            )            44                        45                        # Brand any directories needed to put the output file into every bit Python expects            46                        os            .            makedirs            (            bone            .            path            .            dirname            (            dest_fpath            ),            exist_ok            =            Truthful            )            47                        48                        # Copy the file            49                        shutil            .            copyfile            (            src_fpath            ,            dest_fpath            )          

[ ]

  1. Create a new file (for example from the final): 6 minecraft-music-extractor.sh
  2. Paste the following into the file: (when you lot run the file, it'll ask you what your Windows username is and Minecraft version, the rest is automatic, and outputs to the desktop)
  3. Update the variables (e.thousand. MINECRAFT_ASSETS_DIR) with your correct directory paths
  4. If you lot want all sounds, replace "grep music" with "grep sounds", if yous want the records, replace "grep music" with "grep records", these are shown commented out above the line of code.
  5. Run the script from final with "bash minecraft-music-extractor.sh".
                                      i                        #!/bin/bash                          two                        #                          3                        # Description: Minecraft Music Extractor                          four                                      five                        echo            -e            "Enter your Windows username:"                          vi                        read            winusername                          vii                        echo                          8                                      9                        USER_DIR            =            "/mnt/c/Users/            $winusername            "            10                        eleven                        # Windows Profile doesn't exist = Can't run            12                        if            [            !            $(ls /mnt/c/Users/            |            grep            $winusername            )            ]            ;            and so            13                        repeat            -e            "Unable to run, you entered an invalid user."            xiv                        repeat            -e            "Make sure you lot entered everything correctly, spelled right with caps and lower example.\n"            xv                        read            -p            "Press [Enter] key to keep..."            &&            get out            16                        fi            17                        18                        MINECRAFT_ASSETS_DIR            =            "            $USER_DIR            /AppData/Roaming/.minecraft/assets"            nineteen                        OUTPUT_DIR            =            "            $USER_DIR            /Desktop"            20                        21                        echo            -eastward            "Enter the Minecraft version you desire to extract from:"            22                        read            version            23                        repeat            24                        25                        JSON_FILE            =            $(            echo            $MINECRAFT_ASSETS_DIR/indexes/$version.json            |            grep            "/"            )            26                        27                        # Version doesn't exist = Can't run            28                        if            [            ! -f            $JSON_FILE            ]            ;            then            29                        repeat            -e            "Unable to extract considering that version isn't downloaded or doesn't exist."            30                        echo            -e            "Make sure to open the launcher and download the version you lot need to create a pack for.\n"            31                        read            -p            "Press [Enter] key to continue..."            &&            exit            32                        fi            33                        34                        # for ENTRY in `cat "$JSON_FILE" | python -c 'import sys,json; from pprint import pprint; data = json.load(sys.stdin); pprint(data);' | grep music | awk -F\' '{print $2 "," $6}'`            35                        # cat "$JSON_FILE" | python -c 'import sys,json; from pprint import pprint; data = json.load(sys.stdin); pprint(data);'            36                        # cat "$JSON_FILE" | python -c 'import sys,json; from pprint import pprint; information = json.load(sys.stdin); pprint(data);' | grep sounds            37                        # cat "$JSON_FILE" | python -c 'import sys,json; from pprint import pprint; data = json.load(sys.stdin); pprint(data);' | grep records            38                        39                        for            ENTRY in            `cat            "            $JSON_FILE            "            |            python -c            'import sys,json; from pprint import pprint; information = json.load(sys.stdin); pprint(data);'            |            grep music            |            awk -F\'            '{print $two "," $6}'            `            xl                        exercise            41                        echo            "Processing                        $ENTRY            ..."            42                        echo            $ENTRY            |            cutting -d, -f1            43                        FILENAME            =            `            repeat            $ENTRY            |            cut -d, -f1`            44                        FILEHASH            =            `            repeat            $ENTRY            |            cut -d, -f2`            45                        46                        #Locate the file in the assets directory structure            47                        FULLPATH_HASHFILE            =            `observe            "            $MINECRAFT_ASSETS_DIR            "            -name            $FILEHASH            `            48                        49                        #Copy the file            fifty                        51                        mkdir -p            $OUTPUT_DIR/`            echo            $FILENAME            |            sed -E            's/\/[a-z0-9_]+\..+//'            `            52                        cp            "            $FULLPATH_HASHFILE            "            "            $OUTPUT_DIR            /            $FILENAME            "            53                        54                        washed          

[ ]

  1. Create a new file (for instance from the last): vi minecraft-music-extractor.sh
  2. Paste the following into the file: (when you run the file, it'll ask y'all what Minecraft version, the residual is automatic, and outputs to the desktop)
                                      1                        #!/bin/bash                          2                        #                          iii                        # Description: Minecraft Music Extractor                          four                                      5                        USER_DIR            =            $(            echo            ~            |            grep            "/"            )                          6                        MINECRAFT_ASSETS_DIR            =            "            $USER_DIR            /.minecraft/assets"                          7                        OUTPUT_DIR            =            "            $USER_DIR            /Desktop"                          8                                      ix                        echo            -east            "Enter the Minecraft version you want to extract from:"            x                        read            version            11                        echo            12                        13                        JSON_FILE            =            "            $MINECRAFT_ASSETS_DIR            /indexes/            $version            .json"            fourteen                        fifteen                        # Version doesn't be = Can't run            16                        if            [            ! -f            $JSON_FILE            ]            ;            and so            17                        echo            -e            "Unable to extract because that version isn't downloaded or doesn't exist without orgins."            xviii                        echo            -e            "Brand sure to open the launcher and download the version you need to create a pack for.\n"            19                        read            -p            "Press [Enter] key to continue..."            &&            exit            20                        fi            21                        22                        #for ENTRY in `true cat "$JSON_FILE" | python -c 'import sys,json; from pprint import pprint; data = json.load(sys.stdin); pprint(information);' | grep music | awk -F\' '{impress $2 "," $6}'`            23                        #true cat "$JSON_FILE" | python -c 'import sys,json; from pprint import pprint; data = json.load(sys.stdin); pprint(data);'            24                        #cat "$JSON_FILE" | python -c 'import sys,json; from pprint import pprint; data = json.load(sys.stdin); pprint(data);' | grep music            25                        26                        27                        for            ENTRY in            `true cat            "            $JSON_FILE            "            |            python -c            'import sys,json; from pprint import pprint; data = json.load(sys.stdin); pprint(information);'            |            grep sounds            |            awk -F\'            '{impress $2 "," $vi}'            `            28                        exercise            29                        repeat            "Processing                        $ENTRY            ..."            30                        echo            $ENTRY            |            cut -d, -f1            31                        FILENAME            =            `            echo            $ENTRY            |            cutting -d, -f1`            32                        FILEHASH            =            `            echo            $ENTRY            |            cut -d, -f2`            33                        34                        #Locate the file in the assets directory structure            35                        FULLPATH_HASHFILE            =            `observe            "            $MINECRAFT_ASSETS_DIR            "            -name            $FILEHASH            `            36                        37                        #Copy the file            38                        39                        mkdir -p            $OUTPUT_DIR/`            echo            $FILENAME            |            sed -East            's/\/[a-z0-9_]+\..+//'            `            40                        cp            "            $FULLPATH_HASHFILE            "            "            $OUTPUT_DIR            /            $FILENAME            "            41                        42                        washed          
  1. If you want all sounds, replace "grep music" with "grep sounds".
  2. You may need to run `chmod u+10 minecraft-music-extractor.sh` if the script isn't executing.
  3. Run the script from terminal with "./minecraft-music-extractor.sh".

[ ]

  1. Create a new file (for example from the final), type in and hit enter: vi minecraft-music-extractor.sh
  2. Paste the following into the file:
                                      1                        #!/bin/sh                          ii                        #                          3                        # Description: Minecraft Music Extractor                          4                                      v                        MINECRAFT_ASSETS_DIR            =            "/Users/YOURUSERNAMEHERE/Library/Application Support/minecraft/assets"                          6                        OUTPUT_DIR            =            "/Users/YOURUSERNAMEHERE/Desktop"                          7                        JSON_FILE            =            "/Users/YOURUSERNAMEHERE/Library/Application Back up/minecraft/assets/indexes/YOURJSON.json"                          eight                                      nine                        #for ENTRY in `true cat "$JSON_FILE" | python -c 'import sys,json; from pprint import pprint; information = json.load(sys.stdin); pprint(data);' | grep music | awk -F\' '{impress $2 "," $6}'`            x                        #cat "$JSON_FILE" | python -c 'import sys,json; from pprint import pprint; data = json.load(sys.stdin); pprint(data);'            xi                        #cat "$JSON_FILE" | python -c 'import sys,json; from pprint import pprint; data = json.load(sys.stdin); pprint(information);' | grep music            12                        13                        fourteen                        for            ENTRY in            `cat            "            $JSON_FILE            "            |            python -c            'import sys,json; from pprint import pprint; data = json.load(sys.stdin); pprint(data);'            |            grep sounds            |            awk -F\'            '{print $2 "," $half-dozen}'            `            15                        do            16                        echo            "Processing                        $ENTRY            ..."            17                        echo            $ENTRY            |            cut -d, -f1            18                        FILENAME            =            `            echo            $ENTRY            |            cutting -d, -f1`            19                        FILEHASH            =            `            repeat            $ENTRY            |            cut -d, -f2`            20                        21                        #Locate the file in the assets directory structure            22                        FULLPATH_HASHFILE            =            `find            "            $MINECRAFT_ASSETS_DIR            "            -name            $FILEHASH            `            23                        24                        #Copy the file            25                        26                        mkdir -p            $OUTPUT_DIR/`            echo            $FILENAME            |            sed -Eastward            's/\/[a-z0-9_]+\..+//'            `            27                        cp            "            $FULLPATH_HASHFILE            "            "            $OUTPUT_DIR            /            $FILENAME            "            28                        29                        done          
  1. Update the variables (i.e. YOURUSERNAMEHERE and YOURJSON) with your correct directory paths.
  2. If you desire all sounds, replace "grep music" with "grep sounds".
  3. Hit esc to quit edit way, then type ":wq" to salve and quit the script.
  4. Starting time a new line and run the script simply saved by typing and hit enter: "fustigate minecraft-music-extractor.sh".

Onetime sound directory (pre-1.7.ii) [ ]

If you play the game before 1.7.two, the sound directory is located as follows:

  • Windows: %AppData%\.minecraft\assets or %AppData%\.minecraft\assets\virtual\legacy
  • macOS: ~/Library/Application Support/minecraft/assets
  • Linux: ~/.minecraft/assets

If you have played both the old and new versions, then both the old and new directories will be in the game files. The quondam directory is but used for pre-ane.7 versions.

Legacy sub-folders [ ]

In .minecraft\assets\virtual\legacy\sounds, at that place are xiii sub folders:

  • ambient: Ambiance and rain/thunder
  • damage: Sounds of the player taking damage
  • dig: Breaking blocks
  • burn: Fire sounds
  • firework: Fireworks audio effects
  • liquids: Sounds fabricated by liquids such as water and lava
  • minecart: Sounds created by moving minecarts
  • mob: Mob sounds
  • music: Background music by C418
  • random: Diverse sound effects from eating to explosions
  • records: Music on the record discs found
  • stride: Footsteps
  • tile: Pistons

Warning [ ]

If you edit, add, or remove sounds direct in the sound directory, executing the launcher and so launching Minecraft while continued to the Internet will automatically re-download and revert whatsoever changes you lot've made to the sound directory, deleting your work. This applies for both the new and quondam sound directories. Disconnecting from the Internet before launching the game will not revert the files, simply this is not recommended. The best method to safely store custom sounds is to create your own resource pack.

Video tutorials [ ]

Minecraft Tutorial: Locate the Minecraft Sound Directory and Catechumen Audio Files (Old audio directory only)

See also [ ]

  • Sounds.json

Source: https://minecraft.fandom.com/wiki/Tutorials/Sound_directory

Posted by: birchdelitth60.blogspot.com

0 Response to "How To Change Sounds In Minecraft Resource Packs"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel