{{exclusive|java}} {{cleanup}} {{TOC|right}} == Preface == [[Resource pack]]s allow users to include files that can modify or add custom textures, models, animations, music, sounds, user interfaces, and languages that change the way some things in ''Minecraft'' behave or look. === What NOT to do === There are some things that you should ''NOT'' do when creating a resource pack / texture packs, which includes but is not limited to: *Anything that violates the ''Minecraft'' [https://www.minecraft.net/eula EULA]. *Release files that allow users to play a release of ''Minecraft'' without having purchased it from Mojang. *Release the decompiled source code of ''Minecraft'' in any way. In any case, you should always follow the [https://account.mojang.com/terms Terms and Conditions] on the [[Mojang Studios]] website. ==Getting started== === Making a resource pack=== ''Minecraft'' has a unique mechanic that allows for text and media files to be added to the game files that allow for everything from custom block textures and models to custom credits and sound events. This tutorial is meant to help with setting up the file systems in order to implement them. Since the files are essentially code, there are technical rules for how to format files and certain things may change from version to version. As such, what is written in this tutorial may not apply to every situation, but in the case where the difference is significant and specific, it provides a framework on the changes needed for different versions. ''This tutorial is geared toward the latest release of ''Minecraft'', which is currently 1.21. It may be compatible with another version, but compatibility is not guaranteed.'' ===Tools=== Creating custom files for ''Minecraft'', whether in the forms of resource/data packs or mods, is somewhat technical and can be difficult. There are many rules that must be followed in order for add-ons to work correctly, most notably how the files are formatted. There are many tools that can help mitigate these issues, some of which are listed here. ====File archiver==== To access the base assets of ''Minecraft'' to edit textures, models, or sounds, a file archiver is needed. [https://www.7-zip.org 7-Zip] or [https://www.rarlab.com/download.htm WinRAR] are suggested. MacOS has a built-in file archiver called "Archive Utility" that can be used, but if an alternative is wanted, [https://apps.apple.com/us/app/the-unarchiver/id425424353?mt=12 The Unarchiver] also works. ====Editor ==== Making a resource pack involves creating [[JSON]] text files, which can be tricky to use and format correctly, especially for people who have never had any contact with this format before, and are coming across it for the first time while trying to create resources for ''Minecraft''. Fortunately, for the user's convenience, many file editors assist with formatting these files and making sure proper syntax is used. Here are some suggestions: * [https://notepad-plus-plus.org/ Notepad++] - A very lightweight and text editor for Windows, very easy to use * [https://code.visualstudio.com Visual Studio Code] – More complex code editor better suited for those who have experience with working in such editors * [https://jsonformatter.org/json-parser jsonformatter.org] – a web application for JSON formatting ====Audio editor==== In order to add sound files, you must put it in the proper format (.ogg). While this can be done using one of numerous sites online, an audio editor program is suggested to allow customizing or trimming of audio files. [https://www.audacityteam.org Audacity] is one of the most popular audio editors. ====Image editor/3D modeling tool==== To add textures or custom models, it is suggested to use a modeling program that allows for a visual-based editing system. Like with audio conversion websites, there are many online tools, though a common recommended program is [https://blockbench.net Blockbench]. Most image editors suffice to modify textures, but it is recommended to use an editor that supports [[transparency]] such as [https://www.getpaint.net/index.html paint.net] or https://pixlr.com/ so that you may add transparent pixels to textures. ==Creating a resource pack== All the resources and instructions in a pack reside in the pack folder, which lives in the "resourcepacks" directory. ''In versions 1.11 and higher, all file names within a resource pack should use lowercase letters only.'' ===Creating the folder=== === Folder structure === A resource pack needs to follow a specific folder structure. Every content in your resource pack has its own place.
assets
. Simply create a new folder inside your resource pack folder named assets
. This, pack.mcmeta
, and pack.png
should be the only files located directly in your parent resource pack folder. Any other resource files must be located somewhere in assets
or they won't be read by ''Minecraft''.
====Adding a namespace folder====
Next, inside your assets folder are your namespace folders. These help separate the files in your resource pack so that there is no confusion between which files are located where. If you plan on modifying or replacing vanilla resources, those files would go into the minecraft
namespace folder. Custom additions should go in your own namespace folder, which for this tutorial is named custom
. In the future, you should use a significant or unique namespace so that there isn't a possibility of other resource packs confusing which files belong where when multiple packs are loaded.
===Accessing the vanilla resources ===
If you plan on editing multiple resources, or to help ease of access, you may want to save a copy of the vanilla resources in an accessible location in case some things rely on other files within the directory. To do this, you need to navigate to the vanilla resources file by opening the versions
folder inside the .minecraft
directory. You should see a list of numbered folders, which correspond to versions that you've loaded or used in the past. Open the folder corresponding to the version you want for your resource pack (in this tutorial it would be 1.20.6) and extract the JAR file located inside, which can be done by right clicking the file and selecting a file archiver from the "Open With" option. You may want to save this in an accessible location for future reference, as certain tasks such as modifying block models require textures in addition to the model files. If you do not have a program that can open .jar files simply change the extension from .jar to .zip.
=== Modifying an entity's texture===
This section goes through the process of modifying a texture, using the creeper texture as an example.
====Finding the vanilla texture====
First, you need the vanilla resource to get the texture you want to edit. This is located in the extracted version folder that was created in the previous section. In the extracted folder, navigate to assets
→minecraft
→textures
→entity
→creeper
where you can find creeper.png
. Save a duplicate of this file somewhere accessible or keep the folder window open during the next few steps.
[[File:CreeperTexture1.png|thumb|360px|The creeper texture loaded in paint.net.]]
Next you'll need to replicate the folder structure of the vanilla pack within your resource pack, which lets ''Minecraft'' know to use the texture. Since we are modifying a default texture, this is in the minecraft
subfolder of our assets
folder. Within the minecraft
folder of ''your resource pack'', do the following:
#Inside {{cd|minecraft}}, create a folder called {{cd|textures}}.
#Inside {{cd|textures}}, create a folder called {{cd|entity}}.
#Inside {{cd|entity}}, create a folder called {{cd|creeper}}.
# Copy the creeper texture from the vanilla resource pack into your newly created creeper
folder.
Now that you have the normal creeper texture placed in your resource pack, open it up in the image editor of your choice. It should look something like the image shown.
Since texture files are very small, you may need to zoom in.
;A quick note on textures
If you've never seen a texture before, the above image might surprise you. A lot of textures look this way and are "wrapped" around a model, like wrapping paper around a present.
[[File:LargerTextureLayoutMap.png|thumb|246px|Color-coded Texture. Sections of the same color always face the same direction.]]
Now it's time to be creative! Edit the texture however you want. For simplicity, this example adds a headband. Note where the changes are and compare it to the color-coded texture above.
[[File:Creeperheadband.png|thumb|202px|left|Creeper texture with a red headband.]]
Once you are happy with your texture, save the file as creeper.png
. It is important that it is saved with the same name as the default asset or otherwise it cannot detect and load your texture.
Now you can load up ''Minecraft'' and spawn a creeper with your custom texture! If it doesn't show up, make sure that you've selected your resource pack. If it still doesn't work, make sure you've named the file properly and placed it in the correct folder.
[[File:ResourcePackNewCreeper.png|thumb|260px|Here's the creeper with the new texture as it appears in-game.]]
=====Pack hierarchy=====
If you are playing with multiple resource packs loaded, there may be some textures that are in your pack that aren't being shown. This is because of the way resource packs are loaded in ''Minecraft''. All selected resource pack files are loaded from the bottom up as they are shown in the selection menu, so if there is a resource pack that is loaded above yours, it may replace files that you've changed. This can cause various issues with using multiple themed resource packs that have differing textures, so make sure you have your resource pack at the top.
===Modeling blocks and items===
{{Main|Model}}
Sometimes you may want to change one of the ''Minecraft'' models. To do so you need a file archiver to get the default model and texture along with a 3D modeling tool to edit the model. Blockbench works well in this case since it can export directly to the .json
format needed for models.
====Replacing a block====
Because the default [[ladder]] in ''Minecraft'' isn't 3D, you can replace it with your own model. First, get all the ladder's files into this resource pack:
#Open the ''Minecraft'' JAR file using a ZIP viewer of your choice.
*Navigate into the {{cd|assets/minecraft/blockstates}} folder, then extract {{cd|ladder.json}} to {{cd|Tutorial_Resource_Pack/assets/minecraft/blockstates}}
*Navigate into the {{cd|assets/minecraft/models/block}} folder, then extract {{cd|ladder.json}} to {{cd|Tutorial_Resource_Pack/assets/minecraft/models/block}}
*Navigate into the {{cd|assets/minecraft/models/item}} folder, then extract {{cd|ladder.json}} to {{cd|Tutorial_Resource_Pack/assets/minecraft/models/item}}
*Lastly, navigate into the {{cd|assets/minecraft/textures/block}} folder, then extract {{cd|ladder.png}} to {{cd|Tutorial_Resource_Pack/assets/minecraft/textures/block}}.
Now you can either edit the {{cd|ladder.png}} using your preferred image editor, or you can edit it in your preferred modeling editor.
Note: If you are doing a basic "Just Simple Nonanimated Textures" resource pack, the .json files are unnecessary. Otherwise, if you are doing special features to change what the texture looks like when certain parameters are true or false, then the .json files would be necessary. For example, if you created a resource pack that makes grass blocks smooth, the .json files would prevent you from having dirt lines everywhere in your world that already uses code.
====Modeling the ladder - Blockbench====
In modeling the ladder, we use ''[https://blockbench.net/ Blockbench]''. Once you have opened the program, press {{cd|Ctrl+O}} to open the model selection menu. After the open dialog has appeared, go to the location where you saved ladder.json
and select .
You then should be facing a ladder that is on the south side of the box.
*On the menu bar, go to ''"Edit -> Add Cube"'' to create a new block.
*Resize the model to a full-sized cube. Then, under ''Textures'' on the left panel right click {{cd|ladder.png}}, then click ''Apply to Untextured Faces.''
*In the top left, there is an image of the ladder, with a 1×1 highlighted region. Move this to change the texture to what you want it to be. Repeat until all sides of the block are as wanted.
*Go to ''"File -> Save Model"'' and save in {{cd|resourcepacks/Tutorial_Resource_Pack/assets/minecraft/models/block/ladder.json}} (Replace ''"block"'' with ''"blocks"'' for 1.12 and below).
Now we have created a new model for the ladder block in Blockbench.
====Texturing the ladder - paint.net====
Go to [https://getpaint.net/download.html getpaint.net] and download paint.net for free.
*Open paint.net.
*Do Ctrl+O and go to .minecraft/textures/block/ladder.png and double click.
*Edit the Ladder however you want.
*When you're done, press the X button in the top right of the window. It opens a dialog if you changed anything and ask if you want to save your work. Press Save then okay twice. You don't need to change anything in the menus.
====Finishing off====
When you have completed the 3D model of the ladder and saved it, launch ''Minecraft'', and test it out. Place a ladder on a wall, and you should see its replaced model.
===Changing existing sounds or music===
{{info needed section|Changing subtitles of sounds, adding subtitles to existing sounds without them}}
Just like modifying the default textures or models, you can substitute custom sounds in place of the default ones. This example shows how to change the boss music in the [[ender dragon]] fight.
=====Finding a sound's path=====
Similar to the custom texture and models, you'll first need to know the ''path'' of the sound you want to change.
#Inside your [[.minecraft]] folder, navigate to {{cd|assets/indexes}}, which contains a list of numbered .json
files.
#Find the {{cd|.json}} file corresponding to your ''Minecraft'' version (e.g. {{cd|1.19.json}}), and open it with the text editor of your choice.
#In this file you can find all the sounds found in ''Minecraft''. Press {{key|CTRL+F}} to search for your sound.
#*For a list of filenames for music, you can check [[Music#List]]
#Your sound path should look something like this: {{cd|minecraft/sounds/music/game/end/boss.ogg}}
=====Modifying the sound=====
#'''Inside your resource pack folder''', navigate to {{cd|assets/minecraft}}.
# Create a new folder named {{cd|sounds}}.
#Now inside your {{cd|sounds}} folder, you need to create new folders depending on your sound's path. For example, if your path is {{cd|minecraft/sounds/music/game/end/boss.ogg}}, you need to create the folders {{cd|sounds/music/game/end}}.
# In the last folder (in this example, it's {{cd|end}}) you can put in your new sound file. Make sure you named the file to the file that you're replacing, or in this example, {{cd|boss.ogg}}.
#* Note that this file '''must''' be a {{cd|.ogg}} file. To convert your sound file to a {{cd|.ogg}} file, you can use the free website [https://audio.online-convert.com/convert-to-ogg Online-Convert.com]
=====Testing your sound =====
If everything went according to plan, you have now replaced a sound in ''Minecraft''. To test it:
#Make sure you have enabled your resource pack.
#*If you already had ''Minecraft'' open with your resource pack enabled, you can press {{key|F3+T}} to reload all resource packs.
#Use the {{cmd|playsound}} command to play your sound. In our example, type: {{cd|/playsound minecraft:music.dragon master @s}}
===Adding new sounds or music===
{{wip|section=1}}
In addition to modifying default sounds, you can add your own! In this example, a new player hurt sound can be added without replacing any of the current player hurt sounds.
===== Finding the sound path=====
In order to add a sound, you'll need to know where it should actually go by determining its ''path''. Unlike replacing sounds, you should go straight to your resource pack folder and search in there.
#Find and open your version's .json
index file (e.g 1.19.json
) from .minecraft/assets/indexes
.
#Press {{key|CTRL+F}} to search for your sound path.
#*In this case, the location for the player hurt sounds looks like this: {{cd|minecraft/sounds/damage/}}.
=====Adding the folders and sound in your resource pack=====
#Going to your resource pack folder, navigate to Tutorial_Resource_Pack/assets/minecraft
.
#Inside the minecraft
folder, create a folder named {{cd|sounds}}.
#*If you already have a sounds
folder from replacing a default sound, open that folder.
#Within the sounds
folder, create a folder that matches the directory of the sound you want to add. In this case, we are going to create a file called damage
.
#Add your sound here.
#*The sound ''must'' be a {{cd|.ogg}} file. Like in the previous section, you may use the free website [https://audio.online-convert.com/convert-to-ogg Online-Convert.com] or use Audacity as mentioned at the top of the page.
#*Also note the already existing files seen in your {{cd|.json}} file from above. In this case, five other hurt sounds exist within the {{cd|minecraft/sounds/damage/}} folder, two for falling at different heights ({{cd|fallbig.ogg}} and {{cd|fallsmall.ogg}}) and the other three are when the player actually gets hurt ({{cd|hit1.ogg}}, {{cd|hit2.ogg}}, and {{cd|hit3.ogg}}) Since we want to ''add'' a fourth sound to the existing three hurt sounds, we cannot reuse those file names. For simplicity, name your sound {{cd|hit4.ogg}}.
===== Changing the sound event=====
Because we are adding a sound, we must change the associated sound event in {{cd|sounds.json}}.
#Go back to {{cd|assets/minecraft}} in your resource pack folder.
#Create a text file named {{cd|sounds.json}}. Do make sure that the file extension is indeed '''.json''' and nothing else.
#At your choice, paste the following template into {{cd|sounds.json}}: