Minecraft Blogs / Tutorial

How To Make a Resource Pack with Randomized Textures (VANILLA)

  • 31,352 views, 1 today
  • 37
  • 23
  • 41
usa avatar usa
Level 45 : Master Engineer
122
• Link to a resource pack with this tutorial already done: http://goo.gl/CK9vuh

• If a file name has "/" after it, it is a folder. If it is not a folder, it will have its file extension.

Hello! With the arrival of 1.8, you can now use alternate blocks. Granted they are not turned off in the settings, this allows people using your resource pack to see multiple, randmized textures for individual blocks.

1. File setup
In 1.8, the file setup goes as follows for resource packs:

/resourcepack/
assets/
blockstates/
#see sec. 2
font/
lang/
models/
#see sec. 3
blocks/
#see sec 3.1
items/
#see sec 3.2
texts/
textures/
blocks/
#see sec. 4
pack.mcmeta
pack.png

2. blockstates
The folder "blockstates" holds a .json file for every single block and variant of block in the game. These files point to the model (.json file), which will be found in "models/block". The files, by default, should somewhat resemble this for most blocks in the "blockstates" folder (we are using coal ore as an example):

/blockstates/coal_ore.json

{
"variants":{
"normal":{"model":"coal_ore"}
}
}

This is pointing to a model (a .json file) in the file "models / blocks" called "coal_ore.json".

This is fine and dandy if you just want one texture for the block, but we want multiple (alternate) textures. In preparation for this, we will add square brackets around our model (soon to be models):

/blockstates/coal_ore.json

{
"variants":{
"normal":[
{"model":"coal_ore"}
]
}
}

What we did was turn "normal" into an array, or a list. This allows us to point to multiple models for this one block.

Now we will tell Minecraft that the models (or .json files) it is looking for are in a folder called "coal_ore", and that the first is called "0", the second called "1", and the third "2". (assuming you have 3 different textures) You can name these whatever you want, but make sure the model name and its name in the blockstates folder match up. If you didn't change the name, it should look like this:

/blockstates/coal_ore.json

{
"variants":{
"normal":[
{"model":"coal_ore/0"},
{"model":"coal_ore/1"},
{"model":"coal_ore/2"},
"__comment":"The value for the model tag MUST be consistent with the name of the .json file in the folder models/blocks/coal_ore! This is CRUCIAL!"
]
}
}

NOTE: You cannot rename or put any file in a folder in blockstates. The game expects these files to be here. If it does not find a file here, be it because you deleted it or put it in a folder, it will use the default file in its place.

In blockstates, you can also define something called "weight". This makes it so that some models will be shown more often than others. If "0" is our main texture, for instance, and we would like for this model to be displayed more often than the other two, then we can do this:

/blockstates/coal_ore.json

{
"variants":{
"normal":[
{"model":"coal_ore/0","weight":120},
{"model":"coal_ore/1"},
{"model":"coal_ore/2"}
]
}
}

Note that the number is not in quotes. The number is turned into a percentage, so you cannot use deimals. The default value is 1 (which turns to 100%).

3. models
Models has 2 folders: blocks, and items. "Blocks" determine how they are rendered when placed, while "items" determines how they are rendered in your inventory.

3.1. blocks
"Blocks" contains all the models (.json files) for every tile in the game. Some blocks have multiple tiles, such as beds, and thus will have multiple models (.json files).

What we want to do is make a seperate folder inside "models/blocks/" for our coal ore models. In our case, it will be called "coal_ore", and we will move the "coal_ore.json" file, which should already be inside the "blocks" folder, to our "coal_ore" folder.

So instead of our file structure looking like this:

/blocks
coal_ore.json

we will have this:

/blocks
/coal_ore (new folder)
coal_ore.json

We will then rename the .json file "0", and then duplucate it so we have one for every texture we have. In our case, we have 3, so we will duplucate it twice (because we still have the original file, which adds up to 3). Our file structure should resemble this:

/blocks
/coal_ore
0.json (formerly named "coal_ore.json")
1.json (dupe of 0)
2.json (dupe of 0)

We will then go inside of each of these files and change point to where we will have our textures. This is the default file:

/models/blocks/coal_ore.json:

{
"parent": "block/cube_all", "__comment":"cube_all is the parent model (.json file)",
"textures":{
"all": "blocks/coal_ore"
}
}

Ours will look like this since we plan on putting our alternate textures (.png files) in a new folder, that being "/textures/blocks/coal_ore/" and naming them "0","1", and "2". Keep in mind we have already put these models (.json files) in a folder called "coal_ore" to help us stay organized.

/models/blocks/coal_ore/0.json:

{
"parent": "block/cube_all",
"textures": {
"all": "blocks/coal_ore/0"
}
}

/models/blocks/coal_ore/1.json:

{
"parent": "block/cube_all",
"textures": {
"all": "blocks/coal_ore/1"
}
}

/models/blocks/coal_ore/2.json:

{
"parent": "block/cube_all",
"textures": {
"all": "blocks/coal_ore/2"
}
}

3.2. items
I don't really need to go over this in great detail. If put your texture in a folder, it will no longer show in the inventory unless you point to it again in its .json file in the "items" folder, which is in the "models" folder.

In our case, it would look like this:

/models/item/coal_ore.json:

{
"parent": "block/coal_ore/0",
"display": {
"thirdperson": {
"rotation": [ 10, -45, 170 ],
"translation": [ 0, 1.5, -2.75 ],
"scale": [ 0.375, 0.375, 0.375 ]
}
}
}

As you can see, you can also change how your character holds the block with the "display" tag.

4. blocks
Located in "textures", "blocks" is where your block textures (.png files) are put.

For us, since we are making alternate textures for "coal_ore", we will make a folder called "coal_ore" and put all of our textures in there. The file structure looks like this by default:

/blocks
coal_ore.png

This is what it should look like for us:

/blocks
/coal_ore
0.png
1.png
2.png

You're done! Good job- give yourself a pat on the back. It can be somewhat confusing the first time, but do a few more blocks and you will most definitely get the hang of it.

If you enjoyed the tutorial, I would appreciate it greatly if you diamonded / favorited / subscribed. I plan on doing more resource pack tutorials in the near future!v
v
Tags

3 Update Logs

Update #3 : by usa 10/12/2014 4:58:07 pmOct 12th, 2014

added a download link for a resource pack with this already done so you can follow along more easily.
LOAD MORE LOGS

Create an account or sign in to comment.

2
10/12/2019 3:35 pm
Level 18 : Journeyman Crafter
Sharkz230
Sharkz230 avatar
I made an updated version for 1.12.2 with instructions and download. IDK if anyone still looks at this one but it mine is simpler to use.
1
10/16/2016 9:37 am
Level 17 : Journeyman Warrior
Clockwork Studio
Clockwork Studio avatar
Nice Tutorial! Really helped me! :D

I will use this for my Adventure Map!

EDIT:



I would love to see a WORKING updated version of this....

EDIT EDIT:

And it would be nice to repair the download link ._.
1
10/20/2016 1:12 am
Level 45 : Master Engineer
usa
usa avatar
sorry, the obama administration has been very busy with supporting hillary clinton's campaign, we may update this tutorial after the election is done and everything has settled down.
1
10/20/2016 3:01 pm
Level 17 : Journeyman Warrior
Clockwork Studio
Clockwork Studio avatar
lol. thx :D
1
09/01/2016 6:18 pm
Level 3 : Apprentice Network
Suphacker_Tem
Suphacker_Tem avatar
this is rlly outdated
1
08/30/2016 6:03 am
Level 3 : Apprentice Network
Suphacker_Tem
Suphacker_Tem avatar
You're not supposed to put the .json files or the .png files IN FOLDERS just put them next to each other. the files don't work
1
08/25/2016 4:37 am
Level 1 : New Miner
Stulto
Stulto avatar
I'm having problems with randomizing animated textures... Any help?

Even if you can't thanks. :D
1
05/31/2016 10:00 am
Level 1 : New Miner
ebeldiebebel
ebeldiebebel avatar
hey there, thi tutorial helped me, but i keep getting the purple and black texture, and I even checked if all the brackets where correct, i am not a programmer but i checked if for every opening was a closing :) Is there something i am doing wrong? does the place where the brackets are make any difference? in the items file i also changed it to; /block/coal_ore/0 but that only changed the item in my hand from the basic texture to the purple and black one... any help?

still thanks either way :D
1
05/31/2016 7:06 pm
Level 45 : Master Engineer
usa
usa avatar
don't put the "/" in front of "block/coal_ore/0" ever. check to make sure thats not your problem.
1
06/01/2016 8:46 am
Level 1 : New Miner
ebeldiebebel
ebeldiebebel avatar
checked it, removed it, and still shows the same problem..
thanks for the fast reply anyway
Planet Minecraft

Website

© 2010 - 2023
www.planetminecraft.com

Welcome