Hey there. So I tried to create an animated texture for my resource pack and here's what I did. To test it out, I opened the Sponge texture in Photoshop and made it 128 pixels high and 16 wide.. and did something like this:
(The bottom 16 x 16 square is transparent but shows up as white on here)
And, I created a file called sponge.png.mcmeta, opened it up, and pasted in this code:
However instead of achieving a rainbow-like animated block like I had hoped for, this is the result (the image is chopped off, well it is for me. Right click it and click view image for the whole thing):
Help would be appreciated! I'm pretty sure the reason is because I've got the code wrong in the sponge.png.mcmeta file, that or because the last 16 by 16 square in the sponge.png is transparent. Not really sure. Thanks!
The reason it's doing that is because you have listed one more frame in the mcmeta file than actually exists. The mcmeta file thinks your animation has 9 frames, when it really only has 8. The last number in your list should be 7. The frame indexes start at 0, which can be a little confusing for people not familiar with computer programming.
This can come in handy when I make an animated texture. So I am following.
Basically, do exactly what I did in the OP except you can make the texture any dimension as long as it is 16 wide and the height is something times 16, where the something is the number of frames. Also, in the mcmeta file, don't put 0, 1, 2, 3, 4, 5, 6, 7, 8 like I did, only go up to 7 because the 0 is counted, and since there are 8 frames, you only need 8 numbers in the file. You can also put the numbers in any order if you want the animation to change.
(The bottom 16 x 16 square is transparent but shows up as white on here)
And, I created a file called sponge.png.mcmeta, opened it up, and pasted in this code:
However instead of achieving a rainbow-like animated block like I had hoped for, this is the result (the image is chopped off, well it is for me. Right click it and click view image for the whole thing):
Help would be appreciated! I'm pretty sure the reason is because I've got the code wrong in the sponge.png.mcmeta file, that or because the last 16 by 16 square in the sponge.png is transparent. Not really sure. Thanks!
Basically, do exactly what I did in the OP except you can make the texture any dimension as long as it is 16 wide and the height is something times 16, where the something is the number of frames. Also, in the mcmeta file, don't put 0, 1, 2, 3, 4, 5, 6, 7, 8 like I did, only go up to 7 because the 0 is counted, and since there are 8 frames, you only need 8 numbers in the file. You can also put the numbers in any order if you want the animation to change.