The first thing we want to do is create the custom texture for our new custom item!
We do this by using Custom Model Data.
Custom Model Data, added in 1.14, is simply an NBT tag that allows for the same item to not only keep its original texture, but also have multiple different custom textures!
Setting up Custom Model Data is relatively straightforward:
Go to the "Custom Item Resource Pack" Folder in your resource packs folder and navigate through the folders as shown: assets/minecraft/models/item/
Once there open up the file, "snowball.json". (Yes, snowball...)
You can use any text editor you like, but I recommend Visual Studio Code.
Go to the section that looks like this:
"overrides": [
{"predicate":{"custom_model_data":1}, "model":"item/snowball/1"},
{"predicate":{"custom_model_data":2}, "model":"item/snowball/2"},
{"predicate":{"custom_model_data":3}, "model":"item/snowball/3"},
...
{"predicate":{"custom_model_data":#}, "model":"item/snowball/#"}
]
To set up the new model data, copy one of the "predicate" lines, paste it below all of the other ones, add a comma after the previous line, and increment both cases of the number. It should now look something like:
"overrides": [
{"predicate":{"custom_model_data":1}, "model":"item/snowball/1"},
{"predicate":{"custom_model_data":2}, "model":"item/snowball/2"},
{"predicate":{"custom_model_data":3}, "model":"item/snowball/3"},
...
{"predicate":{"custom_model_data":#}, "model":"item/snowball/#"},
{"predicate":{"custom_model_data":#+1}, "model":"item/snowball/#+1"}
]
The number that this new line has will be called the Model Data Value from now on. (MDV)
* DON'T FORGET TO SAVE THE FILE! (Ctrl + S) *
You can now close the "snowball.json" file and go in the "snowball" folder.
Copy/paste one of the files already there and rename it to the MDV (Step 2).
Open this new file and change the 2nd number on line 4 (not "layer0") to the MDV:
"layer0":"item/snowball/<OLD NUMBER>"
|
V
"layer0":"item/snowball/<MDV>"
You can also change how the item looks in a player's hand. In line 2, you can mainly choose between "handheld" or "generated":
Handheld: Items like swords, axes, shovels, etc.
Generated: Items like just about everything else.
"parent":"item/handheld",
or
"parent":"item/generated",
Texture time...
* DON'T FORGET TO SAVE THE FILE! (Ctrl + S) *
There is a PLETHORA of texture making software. I use GIMP, but others may work better for you.
This tutorial will not be demonstrating how to create the custom textures themselves, but there are many incredible tutorials online. However, here are some pro tips:
Typically, minecraft textures are 16x16 pixels.
Make sure you save/export your image as a .PNG file.
If you're taking inspiration from already existing items or things from real life (which I recommend), try copying and pasting images from online into your image and adding/removing from it.
If you can, get other people's opinion of your image as your making it, sometimes people can provide awesome ideas.
"Handheld" items are grabbed by the bottom left corner of the texture.
Once you've created your masterpiece, save and name it to, "#.png". # being the MDV.
Take the image from wherever you saved it at put it in the folder navigated to as shown: Custom Item Resource Pack/assets/minecraft/textures/item/snowball/.
The time has come...
Now you can test out your texture!
Open up Minecraft and make sure the resource pack is selected in the options menu.
If you're already in a world, do 'F3 + T' to reload the resource pack. Otherwise, open a world and run the following command:
" /give @s minecraft:snowball{CustomModelData:#} " # being the MDV
If everything went accordingly, you should now have a snowball with your custom texture and you can move into the datapack aspect of your custom item!
If your texture displayed correctly, you can skip this step, but if it didn't, try running through this checklist. If none of these work try searching on Google. DON'T GIVE UP!
* IMPORTANT: Make sure to reload the resource pack (F3 + T) (when inside a world) after trying any of these:
Incorrect or Default Texture:
Make sure all of the files involved in steps 2, 3, and 4 have the correct MDV (Step 2). If the tutorial was followed. All instances of the number you added should be the same. (Files names and values in code)
Make sure files from steps 3 and 4 are in their correct locations according to the tutorial.
Make sure that all of the files have been saved.
Make sure the correct resource pack is selected in the resource packs screen of the options menu.
Try reloading the resource pack. (F3 + T)
Other resource packs may be conflicting, so try disabling all other resource packs besides this one.
Trying the old turn it off and on again never hurts.
Re-run through the tutorial to make sure you didn't miss anything.
Item Is Held In The Hand Weirdly Or Is Too Big:
Go back to step 3 and look at the part that talks about handheld vs. generated.
Try reloading the resource pack. (F3 + T)