If you're looking to, say, have 3+ different textures for the dirt block, look no further!
This step is divided into two parts that you must do to achieve a randomized texture. You will have to make a model file for each alternative texture you want, and a blockstates file to pull it all together.
Step ONE - Model Files
- Create your textures [ For example here i will be using dirt ]
- Name them dirt.png, dirt1.png, dirt2.png,
- Place them into the correct folder location [YOURTEXTUREPACK/assets/minecraft/textures/block]
- Create a folder in [YOURTEXTUREPACK/assets/minecraft] and name it models
- In the 'models' folder you will add another folder called block [YOURTEXTUREPACK/assets/minecraft/models/block]
- Inside the block folder, you will have your model files. Because we are doing 3 different textures for dirt, there will be three
different model files. So, you will create dirt.JSON, dirt1.JSON, and dirt2.JSON. [ You can name these whatever you like if the
numbers get you confused. You could do dirt, dirt2, dirt3 instead. ]
└ To make this even easier, you can navigate to %appdata% ->.minecraft/versions/[VERSION#HERE] and go into the .JAR file
and copy the original model file for dirt, and paste it 3 times in your folder, naming them accordingly.
- If you copied the dirt file, you will see the original file structure inside when you open it up. If not, I'll add it below for dirt
{
"parent": "block/cube_all",
"textures": {
"all": "block/dirt"
}
}
Every model file needs it's own directory for the texture we have added. So inside the dirt.JSON file, "all": "block/dirt" means
the texture is taking from the block folder and the texture called dirt. Your dirt1.JSON should have a directory of
"all": "block/dirt2", and dirt2.JSON will have "all": "block/dirt3" inside.
All your model files should be done now, so we move onto the next part, blockstates.
Step TWO - Blockstates
- Create a folder in [YOURTEXTUREPACK/assets/minecraft] and name it blockstates
- Create a file inside this new folder called dirt.JSON
└ This file is going to tell the game all the models you made are intended for ONE block.
- You can, again, copy the original blockstates file the same way you copied the model file. For convenience, here is how this
file should look inside
{
"variants": {
"": [ { "model": "block/dirt", "weight": 2 }, { "model": "block/dirt2", "weight": 1 }, { "model": "block/dirt3", "weight": 1 } ]
}
}
└ You can add lots of model modifiers here.
The minecraft wiki lists them all here if you want to play around with them. - Change the "weight" setting to determine how much your texture appears. In the code above, we have weights of 2, 1, and 1.
This means original dirt has a 2/4 change to show, while the dirt1 and dirt2 have a 1/4 change. You can completely delete the
weight code if you want this to be a truly random texture, just be mindful of your commas.
This should be all you have to do. If you launch up your pack and the model is present but showing pink and black squares, your textures are in the wrong spot/not correctly directed in the model's folder. Always make sure you're looking at your code. A missed comma or misplaced bracket can make the entire code null.