Hello, I am working on my own resource pack and remember seeing somewhere that someone replaced a single iron bar with the chain from the lantern so that you could hang them from chains. If anyone can direct me to where someone did this or help me with how i could do this with the json file and texture, that would be amazing!
The Meaning of Life, the Universe, and Everything.
This might be a coincidence, but this what I have done recently. I'll help you and show you what I've done.
This first thing you want to do is to make a texture that is specifically the chain of the lantern. What I did was copy a single segment of the chain and paste it in a new file. While making a single strand of a chain will work, its best to split it to make it look more like the lantern's chain (like below).
Afterwards, save this as a new seperate file, like "iron_bars_post." This texture will be exclusively used for a single, stand-alone iron bar. Note that for this texture, I had to make each chain a pixel taller to fit in the 16 pixel height.
Now lets go to the json file of "iron_bars_post.json" found in the models/block.
For the shade, I also copied it from the lantern's model file so the iron bars won't look offcolored to the lantern. Heres what you copy and paste:
For "uv," this is where it gets a bit tricky. They are like coordinates so the file knows where the texture begins and ends (x1, y1, x2, y2).
For the uv under East and West, it will be the left chain of the texture. To get the uv for that side, I did from this red pixel (x1 = 5,y1 = 0) to the blue pixel (x2 = 8, y2 = 16) in the picture below. The final string I would plug in for this would be "[ 5, 0, 8, 16 ]"
The North and South uv is going to be other, right chain. You will do the same thing just with this other chain. The uv I got from it was (x1 = 9, y1 = 0) to (x2 = 12, y2 = 16). The final string for this one would be "[ 9, 0, 12, 16 ]" This one might have you play around with it a bit and do some trial and error, so be warned!
Now, for "bars." Close to the top of the file, you will see a list of textures like "particle" and the one we're changing, "bars." This basically tells the model what file it is going to use. Normally, it would just use the default iron bars, so thats a no go for us. You want to change this from "blocks/iron_bars" to "blocks/iron_bars_post" or whatever else you called your chain texture.
Last is "from" and "to." If you left this unchanged, the chain will be squished together and not match up with the lantern's chain. You basically just want to copy the from and to just above rotation in the lantern's model and paste it in our own file. There are two sets. Here is the first one that is above West/East:
"from": [ 8, 0, 6.5 ],
"to": [ 8, 16, 9.5 ],
And here is the one for North/South:
"from": [ 6.5, 0, 8 ],
"to": [ 9.5, 16, 8 ],
This will stretch out the iron bars' chain to match up.
Now you can finally save the file and move onto one last model file. This is optional but it will cause your chain to have a "cap" above and below every chain. This, unfortunately affects the regular iron bars and I am not sure how to change it so it only affects the chain.
The file you want to go to is called iron_bars_post_ends.json .
In this, you are only changing two things. For both "from"s and "to"s, you are changing each number in the ""s to be '0'. Heres what the file should look like below:
Now you can save this file. Be warned that the pole ends will be gone from the regular iron bars as I'm pretty sure they are hardcoded. I could be wrong however, and I don't know if anyone knows how to change this so it only affects the chain.
That should be the last part done. Now you could create your own iron bars texture to look more like a chainlink fence as I've done, but you could leave the iron bars how they are. If you need any help just tell me and I'll be happy to resolve any as quick as possible. Hope this helps!
Here should be the final look! Note that I went ahead and changed the regular iron bars to match, making it look more like chains.