So you've heard about the neat new modeling system in 1.8 and have no idea how it works? Well this tutorial should *hopefully* help out with that problem. It's my first tutorial so sorry if it seems pretty disjointed, I'm not really the greatest at explaining things.
The assets
If you've worked on a resource pack then it's likely you know how to access the default assets for minecraft. If not, you navigate to the .minecraft folder (where save files and resource packs go) and open up the versions folder and then the folder that corresponds to the latest available version that you have downloaded. At the current state of time this will be '1.8'. This folder should contain at least two files. The one we're looking for is the '1.8.jar' file. Open this up in a program such as 7zip or winrar. Once open, navigate to the assets/minecraft folder. The directory should look like this:
There are two folders you're going to want for editing models or making alternate textures. The 'blockstates' folder and the 'models' fodler. I would recommend grabbing the whole folders (including all the contents) and then copying them over to your pack location. This will save time for future modeling endeavors.
Alternate textures
In this section I will show you how to add alternate textures to your resource pack. This is the same as random ctm from MCPatcher and Optifine if you've used either of those mods.
For this example we will be making some alternate top grass textures.
To start of with you're going to need your actual textures.
Here you can see we have 3 grass textures (yours will most likely be black and white). One of these is the default top grass texture in the pack. This should be called 'grass_top.png' and it can be found in your textures/blocks folder of your resource pack. To keep things consistent I named the other textures 'grass_top1.png' and 'grass_top2.png'. Each texture must have the same resolution as the default texture ('grass_top.png').
It should look something like this in your textures/blocks folder:
Now that we've named our alternate textures it's time to edit the model json file.
This section onwards assumes that you've copied the whole 'models' and 'blockstates' folders into your resource pack.
In your resource pack files, navigate to your 'models' folder and open it up. There should be two folders, 'item' and 'block'. Since we're editing BLOCKS you should open up the 'block' folder. Inside you will see a large list of files. To help with organisation we will create a folder for our new model files. I would recommend making a new folder for every new block you add alternate textures or models for. Create a folder and call it something like 'grass'.
Once the folder is created, scroll down the large list of .json files until you come across 'grass_normal.json'.
NOTE: if you're making alternates for another block just find the corresponding .json file for that block. Please note that sometimes there can be multiple .json files for one block, such as is the case for things like fences - I may cover more complex blocks like that in a future tutorial.
Once 'grass_normal.json' has been located, right click and copy the file. Then scroll back up to the top of the list where your 'grass' folder is (or whatever you named it) and open it. Paste the file inside. Since we have 2 extra variants as well as the default texture, you're going to want to copy and paste the file again so that there are two copies. Name them something appropriately (like 'grass_normal1.json' and 'grass_normal2.json' or something similar) but MAKE SURE they both have a different name than the original 'grass_normal.json'. You need to have separate .json files for each variant you add so keep that in mind.
If done correctly it should look like this:
Now you're going to want to open up both of these files using notepad++ or a similar program (notepad works fine too but the formatting isn't as nice as in notepad++).
Now we get to select what textures the .jsons are pointing to. For 'grass_normal1.json' you want to change the "blocks/grass_top" to "blocks/grass_top1". This means the .json file is now pointing to the texture 'grass_top1' for it's top texture.
Now edit the 'grass_normal2.json' and make it point towards 'grass_top2'.
Once done, save both files and close them. The model .jsons are now complete! Yup - it's as easy as that.
Now we have one final step. Editing the blockstates file.
Navigate over to your assets/minecraft folder within your resource pack. You will now want to open the 'blockstates' folder. Once again, you will be confronted by a large list of .json files. You want to find the 'grass.json' file (or the corresponding file for whatever model you're editing) and open it.
The "y": 90, etc. indicate random rotation. By default the grass top texture can appear as it is in the 'grass_top.png' and also rotated by 90 degrees, 180 degrees and 270 degrees. This can look pretty weird in many packs so we're going to want to delete all the extra model lines for now so that the code looks like this:
Please note that there is now no comma at the end of the '{ "model": "grass_normal" }' line. There should be no commas at the end of the list when you are listing models in a blockstate file or attributes in models files. This is a very easy way to cause models to show as purple and black squares in-game so CHECK YOUR COMMAS!
This code will now only show the default grass texture in-game with no random rotation. If you dislike how your sand, grass, netherrack and a couple of other blocks appear in your resource pack after the 1.8 update, open the blockstates .json file and remove the rotation variants. This will solve the problem.
We, however, want to ADD variants to this list so that the extra textures we made will show up in-game. To do this we need to direct the blockstate file towards the two extra model .json files we made earlier.
To do that, add the extra lines that correspond to those files. The best way to explain this is through looking at the code:
As you can see there are now two extra lines in the file. '{ "model": "grass/grass_normal1" },' and '{ "model": "grass/grass_normal2" }'. The description after '"model":' is actually where the model .json files we made earlier are located. 'grass' indicates the folder and then '/grass_normal1' indicates that it is the file named 'grass_normal1' within said 'grass folder'. If you used a different folder name or different model .json file names, please keep this in mind and modify these lines accordingly.
Now that you've edited the file, check for misplaced commas. If everything looks okay, save the file and you should be done! If you check in-game there should now be the default grass texture as well as 2 others that appear equally as often as each other.
The finished product:
Alternate models - texture weights
There are a few extra things of note in the blockstate .jsons that can be very useful tools for us resource pack creators. The first of these is the '"weight"' specification. If you've used ctm before then you probably know that you can 'weight' your textures so that some textures appear more commonly than others. This is easily achieved with the new 1.8 modeling system too.
To add weights to your textures, all you need to do is add the '"weight"' specification to your blockstates file.
This code will adjust how frequently the extra textures we made for our grass_top will appear. If you add the weights together they make a total of 5 (3 + 1 + 1 = 5). This means that the "grass_normal" model will appear 3 times out of 5 and the two other variants will appear 1 out of 5 times (in theory). With this you can make some variants such as carvings in stone, knots in wood logs and planks, flowers on grass, etc. appear very rarely and not have them spread all throughout the world.
This ends the first part of the tutorial for now. If you have any suggestions please comment them and I'll work on adding them in. I'll add a couple of other sections for some more advanced stuff as well as actually making and implementing custom models later on. Peace!
This ends the first part of the tutorial for now. If you have any suggestions please comment them and I'll work on adding them in. I'll add a couple of other sections for some more advanced stuff as well as actually making and implementing custom models later on. Peace!
I have an suggestion. I think you should know that this has been added to the "The All-Inclusive UPDATED Guide to Texturing" page. Thanks for making something that will help the Resource Pack Community.
I'm not sure if you decided to make this on your own for the main purpose of the texture-y stuff, or if it was because my guide was outdated, but I've finally got around to updating it. I have all of the code snippets updated, now I'm going to work on adding more of the newer workflow stuff, as well as advanced concepts.
But I guess the more people that explain something, the higher chance people will understand it. I think that if you focus it more on texturing stuff (like what you have so far) it might be better. I know my guide is a little technical and some people might JUST want to do stuff like random textures, non-derived textures for stuff like fences, etc.
Rollback Post to RevisionRollBack
"I'm an outsider by choice, but not truly.
It’s the unpleasantness of the system that keeps me out.
I’d rather be in, in a good system. That’s where my discontent comes from:
being forced to choose to stay outside.
My advice: Just keep movin’ straight ahead.
Every now and then you find yourself in a different place."
-George Carlin
NOTE: if you're making alternates for another block just find the corresponding .json file for that block. Please not that sometimes there can be multiple .json files for one block, such as is the case for things like fences - I may cover more complex blocks like that in a future tutorial.
I have an suggestion. I think you should know that this has been added to the "The All-Inclusive UPDATED Guide to Texturing" page. Thanks for making something that will help the Resource Pack Community.
Neat! Thanks for that, nice to know it's earned it's place in that stonking huge thread of all things good.
I'm not sure if you decided to make this on your own for the main purpose of the texture-y stuff, or if it was because my guide was outdated, but I've finally got around to updating it. I have all of the code snippets updated, now I'm going to work on adding more of the newer workflow stuff, as well as advanced concepts.
But I guess the more people that explain something, the higher chance people will understand it. I think that if you focus it more on texturing stuff (like what you have so far) it might be better. I know my guide is a little technical and some people might JUST want to do stuff like random textures, non-derived textures for stuff like fences, etc.
Oh... Didn't know it was updated... That could've saved me some time!
I actually wrote it because I noticed a pretty large number of people complaining there wasn't enough documentation on how models worked for alternate textures among other things so I figured I'd have a go at doing a little tutorial since I think I have a pretty good grasp on the system now.
I don't really intend on going super in-depth in the whole modeling system, I will be sticking more with retexturing stuff like fences which has multiple files, making custom textures for a certain side of a block, etc. Just random stuff like that.
NOTE: if you're making alternates for another block just find the corresponding .json file for that block. Please not that sometimes there can be multiple .json files for one block, such as is the case for things like fences - I may cover more complex blocks like that in a future tutorial.
Spelling error. This is very helpful, thank you!
Ooops, thanks for pointing that out! I'll fix it right away.
Isn't it funny how I just spent about an hour figuring this out, when all along... this was here. At least I learned it.
Oh, nice tutorial. I didn't know about the "weight" parameter, that will help.
Rollback Post to RevisionRollBack
Roses are red, violets are blue, sugar is sweet, and so are you.
The roses are wilted, the violets are dead, the sugar bowl's empty, and so is your head.
Still, I found that teaching myself stuff is often a better way of learning than reading a tutorial. Takes longer, yea, but I feel like I get a better understanding of it and I very quickly learn about common mistakes because I make them.
No worries glim, hopefully it will come of some use to you in the future if you ever convert some of your ctm to vanilla (although there's no repeat ctm in vanilla which is rather unfortunate so it might end up not being worth it as long as mcpatcher and optifine are kept updated)
Great tutorial, but I'm having difficulties with this. I've been maintaining my own texture pack for some time now, and thought I'd have a go at the alternate blocks thing... However, my alternate textures are not showing up, and I've given up troubleshooting myself so was wondering if you can spot where I've been going wrong.
I only see the standard cobblestone texture, none of the alternates. I have made sure alternate blocks is turned on and have tried tweaking the weights to make the alternates more frequent to no avail.
Your model files should be in assets/minecraft/models/block and the blockstate file should be in assets/minecraft/blockstates.
Ha, I've literally just noticed this and came back to retract my plea for help.
I guess I accidentally used 'model/blocks' as that would make sense with 'textures/blocks'. Good old Mojang naming convention consistency, eh? ;D
Mojangs inconsistent naming really can be a bit frustrating sometimes... Guess we've just got to get used to it though - they're never going to change it now.
On a related note I might start writing up the next section of this now that I have some time. I might do adding custom textures to a specific side or face of a block (or multiple faces). That way you can get cool stuff like unique textures for all the half slabs and you can fix some issues like pumpkins having the same top texture and bottom texture which means there are stalks on the bottom of pumpkins.
I have been quite impressed with myself tonight as I figured out how to follow this and add random flowers to my grass. I even conquered 3d carrots and adding the random rotation so they didnt look so uniform. But now I have been stumped by logs as I am trying to add random knots to logs like oak. Using the .json below, I was able to get the knot onto 1 out of every 1000 logs but I was curious if there was a way to make it spawn randomly on just one side of the tree. Is there a peramiter for North/South/East/West face? Thanks
The assets
If you've worked on a resource pack then it's likely you know how to access the default assets for minecraft. If not, you navigate to the .minecraft folder (where save files and resource packs go) and open up the versions folder and then the folder that corresponds to the latest available version that you have downloaded. At the current state of time this will be '1.8'. This folder should contain at least two files. The one we're looking for is the '1.8.jar' file. Open this up in a program such as 7zip or winrar. Once open, navigate to the assets/minecraft folder. The directory should look like this:
There are two folders you're going to want for editing models or making alternate textures. The 'blockstates' folder and the 'models' fodler. I would recommend grabbing the whole folders (including all the contents) and then copying them over to your pack location. This will save time for future modeling endeavors.
Alternate textures
In this section I will show you how to add alternate textures to your resource pack. This is the same as random ctm from MCPatcher and Optifine if you've used either of those mods.
For this example we will be making some alternate top grass textures.
To start of with you're going to need your actual textures.
Here you can see we have 3 grass textures (yours will most likely be black and white). One of these is the default top grass texture in the pack. This should be called 'grass_top.png' and it can be found in your textures/blocks folder of your resource pack. To keep things consistent I named the other textures 'grass_top1.png' and 'grass_top2.png'. Each texture must have the same resolution as the default texture ('grass_top.png').
It should look something like this in your textures/blocks folder:
Now that we've named our alternate textures it's time to edit the model json file.
This section onwards assumes that you've copied the whole 'models' and 'blockstates' folders into your resource pack.
In your resource pack files, navigate to your 'models' folder and open it up. There should be two folders, 'item' and 'block'. Since we're editing BLOCKS you should open up the 'block' folder. Inside you will see a large list of files. To help with organisation we will create a folder for our new model files. I would recommend making a new folder for every new block you add alternate textures or models for. Create a folder and call it something like 'grass'.
Once the folder is created, scroll down the large list of .json files until you come across 'grass_normal.json'.
NOTE: if you're making alternates for another block just find the corresponding .json file for that block. Please note that sometimes there can be multiple .json files for one block, such as is the case for things like fences - I may cover more complex blocks like that in a future tutorial.
Once 'grass_normal.json' has been located, right click and copy the file. Then scroll back up to the top of the list where your 'grass' folder is (or whatever you named it) and open it. Paste the file inside. Since we have 2 extra variants as well as the default texture, you're going to want to copy and paste the file again so that there are two copies. Name them something appropriately (like 'grass_normal1.json' and 'grass_normal2.json' or something similar) but MAKE SURE they both have a different name than the original 'grass_normal.json'. You need to have separate .json files for each variant you add so keep that in mind.
If done correctly it should look like this:
Now you're going to want to open up both of these files using notepad++ or a similar program (notepad works fine too but the formatting isn't as nice as in notepad++).
The code inside should look similar to this:
Now we get to select what textures the .jsons are pointing to. For 'grass_normal1.json' you want to change the "blocks/grass_top" to "blocks/grass_top1". This means the .json file is now pointing to the texture 'grass_top1' for it's top texture.
The code in this case should look like this:
Now edit the 'grass_normal2.json' and make it point towards 'grass_top2'.
Once done, save both files and close them. The model .jsons are now complete! Yup - it's as easy as that.
Now we have one final step. Editing the blockstates file.
Navigate over to your assets/minecraft folder within your resource pack. You will now want to open the 'blockstates' folder. Once again, you will be confronted by a large list of .json files. You want to find the 'grass.json' file (or the corresponding file for whatever model you're editing) and open it.
It should look similar to this:
The "y": 90, etc. indicate random rotation. By default the grass top texture can appear as it is in the 'grass_top.png' and also rotated by 90 degrees, 180 degrees and 270 degrees. This can look pretty weird in many packs so we're going to want to delete all the extra model lines for now so that the code looks like this:
Please note that there is now no comma at the end of the '{ "model": "grass_normal" }' line. There should be no commas at the end of the list when you are listing models in a blockstate file or attributes in models files. This is a very easy way to cause models to show as purple and black squares in-game so CHECK YOUR COMMAS!
This code will now only show the default grass texture in-game with no random rotation. If you dislike how your sand, grass, netherrack and a couple of other blocks appear in your resource pack after the 1.8 update, open the blockstates .json file and remove the rotation variants. This will solve the problem.
We, however, want to ADD variants to this list so that the extra textures we made will show up in-game. To do this we need to direct the blockstate file towards the two extra model .json files we made earlier.
To do that, add the extra lines that correspond to those files. The best way to explain this is through looking at the code:
As you can see there are now two extra lines in the file. '{ "model": "grass/grass_normal1" },' and '{ "model": "grass/grass_normal2" }'. The description after '"model":' is actually where the model .json files we made earlier are located. 'grass' indicates the folder and then '/grass_normal1' indicates that it is the file named 'grass_normal1' within said 'grass folder'. If you used a different folder name or different model .json file names, please keep this in mind and modify these lines accordingly.
Now that you've edited the file, check for misplaced commas. If everything looks okay, save the file and you should be done! If you check in-game there should now be the default grass texture as well as 2 others that appear equally as often as each other.
The finished product:
Alternate models - texture weights
There are a few extra things of note in the blockstate .jsons that can be very useful tools for us resource pack creators. The first of these is the '"weight"' specification. If you've used ctm before then you probably know that you can 'weight' your textures so that some textures appear more commonly than others. This is easily achieved with the new 1.8 modeling system too.
To add weights to your textures, all you need to do is add the '"weight"' specification to your blockstates file.
For example:
This code will adjust how frequently the extra textures we made for our grass_top will appear. If you add the weights together they make a total of 5 (3 + 1 + 1 = 5). This means that the "grass_normal" model will appear 3 times out of 5 and the two other variants will appear 1 out of 5 times (in theory). With this you can make some variants such as carvings in stone, knots in wood logs and planks, flowers on grass, etc. appear very rarely and not have them spread all throughout the world.
This ends the first part of the tutorial for now. If you have any suggestions please comment them and I'll work on adding them in. I'll add a couple of other sections for some more advanced stuff as well as actually making and implementing custom models later on. Peace!
I have an suggestion. I think you should know that this has been added to the "The All-Inclusive UPDATED Guide to Texturing" page. Thanks for making something that will help the Resource Pack Community.
But I guess the more people that explain something, the higher chance people will understand it. I think that if you focus it more on texturing stuff (like what you have so far) it might be better. I know my guide is a little technical and some people might JUST want to do stuff like random textures, non-derived textures for stuff like fences, etc.
"I'm an outsider by choice, but not truly.
It’s the unpleasantness of the system that keeps me out.
I’d rather be in, in a good system. That’s where my discontent comes from:
being forced to choose to stay outside.
My advice: Just keep movin’ straight ahead.
Every now and then you find yourself in a different place."
-George Carlin
Spelling error. This is very helpful, thank you!
Neat! Thanks for that, nice to know it's earned it's place in that stonking huge thread of all things good.
Oh... Didn't know it was updated... That could've saved me some time!
I actually wrote it because I noticed a pretty large number of people complaining there wasn't enough documentation on how models worked for alternate textures among other things so I figured I'd have a go at doing a little tutorial since I think I have a pretty good grasp on the system now.
I don't really intend on going super in-depth in the whole modeling system, I will be sticking more with retexturing stuff like fences which has multiple files, making custom textures for a certain side of a block, etc. Just random stuff like that.
Ooops, thanks for pointing that out! I'll fix it right away.
Lol it's huge but its far from good. It could be a lot better, but thanks & no problem
The last part should have the title "Texture frequency" so you know what it's about. "Extras" doesn't really tell.
Oh, nice tutorial. I didn't know about the "weight" parameter, that will help.
The roses are wilted, the violets are dead, the sugar bowl's empty, and so is your head.
Still, I found that teaching myself stuff is often a better way of learning than reading a tutorial. Takes longer, yea, but I feel like I get a better understanding of it and I very quickly learn about common mistakes because I make them.
Really sorry I forgot to follow up on my enthusiasm for your offer of a tutorial, I just got snowed under with trying to fix and update stuff myself.
I only see the standard cobblestone texture, none of the alternates. I have made sure alternate blocks is turned on and have tried tweaking the weights to make the alternates more frequent to no avail.
I have these files in these places:
assets/minecraft/textures/blocks/
cobblestone.png
cobblestone_1.png
cobblestone_2.png
cobblestone_3.png
assets/minecraft/models/blocks/
cobblestone.json
assets/minecraft/models/blocks/cobblestone/
cobblestone_1.json
cobblestone_2.json
cobblestone_3.json
assets/minecraft/models/blockstates/
cobblestone.json
Cobblestone doesn't even look like a real word anymore, can somebody put me out of my misery, please?
Your model files should be in assets/minecraft/models/block and the blockstate file should be in assets/minecraft/blockstates.
Putting the CENDENT back in transcendent!
Ha, I've literally just noticed this and came back to retract my plea for help.
I guess I accidentally used 'model/blocks' as that would make sense with 'textures/blocks'. Good old Mojang naming convention consistency, eh? ;D
Thank you anyway, much appreciated.
Mojangs inconsistent naming really can be a bit frustrating sometimes... Guess we've just got to get used to it though - they're never going to change it now.
On a related note I might start writing up the next section of this now that I have some time. I might do adding custom textures to a specific side or face of a block (or multiple faces). That way you can get cool stuff like unique textures for all the half slabs and you can fix some issues like pumpkins having the same top texture and bottom texture which means there are stalks on the bottom of pumpkins.
assets\minecraft\textures\blocks
grass_top
grass_top1
grass_top2
models\block\grass
(I made a grass forlder)
grass_normal1:
{
"parent": "block/grass",
"textures": {
"particle": "blocks/dirt",
"bottom": "blocks/dirt",
"top": "blocks/grass_top1",
"side": "blocks/grass_side",
"overlay": "blocks/grass_side_overlay"
}
}
grass_normal2:
{
"parent": "block/grass",
"textures": {
"particle": "blocks/dirt",
"bottom": "blocks/dirt",
"top": "blocks/grass_top2",
"side": "blocks/grass_side",
"overlay": "blocks/grass_side_overlay"
}
}
assets\minecraft\blockstates
grass:
{
"variants": {
"snowy=false": [
{ "model": "grass_normal", "weight": 3 },
{ "model": "grass/grass_normal1", "weight": 1 },
{ "model": "grass/grass_normal2", "weight": 1 }
],
"snowy=true": { "model": "grass_snowed" }
}
}
Your model files are in assets/minecraft/models/block and you have alternate textures turned on, correct?
Putting the CENDENT back in transcendent!
{
"variants": {
"axis=z": [
{ "model": "oak_log_side" },
{ "model": "oaklog/oak_log_side1" }
],
"axis=x": [
{ "model": "oak_log_side", "y": 90 },
{ "model": "oaklog/oak_log_side1", "y": 90 }
],
"axis=y": { "model": "oak_log" },
"axis=none": { "model": "oak_bark" }
}
}
What did I break?
I also realize that my code above doesnt include the 'weight' perimeter like I said it did. Forgot to include it