IMPORTANT: Minecraft Forum recently wrecked this thread. If you find anything that seems off (like sentences ending half way through) please post to let me know. I think that I have fixed everything, but am not 100% sure. Thank you for your patience and cooperation.
If you're reading this thread, it's likely you're either having problems with the new block and item animation format introduced in Minecraft 1.6, or, are new to making animations for Minecraft and want to learn how with as few problems as possible.
Tip: Watch for Green Text:When I write tutorials, I add little tidbits in green text lines. These are often helpful hints or little extras. Keep an eye out for them, as they may prove helpful.
Tip: Look Familiar?:Look Familiar?: If a lot of this tutorial looks familiar, that's because it should be. A lot of this is copy-pasted directly from the previous tutorial: "Making Animated Blocks and Items: The Minecraft 1.5 Way!" If you read that tutorial, and are familiar with the concepts shown in it, scroll down to "Understanding .mcmeta Files" below. Thats' where the bulk of the 1.6 changes are mentioned. Also, if I missed a mention of a .txt file, please point that out so I can edit it. I tried to get everything right, but I'm not perfect.
IMPORTANT: THIS IS ONLY FOR BLOCKS AND ITEMS: If you're trying to animate anything that is not a block or an item (including blocks whose textures are in the /entity/ folder which are rendered as entities and not blocks) you'll need to use MCPatcher and its animation format.
1. The Animation Strip Format: The basic format of an animation is a column of frames. Each individual frame should be the same width and height as the texture you're attempting to animate. For example, if your texture pack is 16x16, each frame in the column should also be 16x16.
Tip: I'm working in 16x16:In all of the examples on this thread, all of the frames are supposed to be at 16x16 resolution. While some, like the image above, are kept at their native resolution (to save on scrolling), I've optimized most of the images for maximum visibility. Don't let this confuse you later on.
In this example, each frame is numbered so you can see its position in the stack. Animated in-game, it will look something like this:
Tip: Starting With Zero:Why is the top frame of an animations strip numbered 0? Because a programmer made the system. In the minds of programmers, zero is the first number in a sequence, preceding the number one. It takes us artsy types a little bit of practice to get use to starting a count with zero, but that's just how computers (or at least computer programmers) work so we'll just have to deal with it.
2. Understanding .mcmeta files:
Every animation in Minecraft must have an accompanying .mcmeta file with it. If it doesn't, Minecraft won't properly read the animation file, and you'll get something that looks like this in game:
Obviously, this is undesirable.
IMPORTANT: READ THE SPOILER ASSOCIATED WITH YOUR OPERATING SYSTEM: Certain operating Systems have behaviors that may prevent you from changing your file extensions easily. If you don't change your files properly, you will have files that have a hidden .txt extension at the end, which will cause Minecraft to ignore your file, believing that it is not a .mcmeta file. For example, you should have "obsidian.png.mcmeta", but with file extensions hidden you may actually have "obsidian.png.mcmeta.TXT" and not even know it. This is why a lot of .mcmeta file fail, so please don't make this mistake.
By default, the Windows Operating systems will hide the file extensions of file types that it thinks are familiar to you. The .txt file is always one of these. To successfully rename a .txt file to a .mcmeta file, you must disable this behavior.
You can find instructions on how to do it by following This Link.
Once the file extension is visble, it should be able to be changed without issue. Ignore the warning dialogue about the file becoming corrupted. Trust me, it won't.
Mac OSX has been known to hide the true file extension of your files, preventing you from removing the .txt extension from the end of your file name. If you're running into the problems, try this:
Select the .png.mcmeta.txt file
Go into file in the toolbar
Click 'get info'
From there, you can truly delete the .txt extension
Thanks to lordofthepies for this information
IMPORTANT: SAVE AS PLAIN TEXT: The simpler the the text editor you use to make these files, the better. Programs like Notepad and Notepad++, which have no text formatting, are best. Other programs, like Window's Wordpad and Mac's Text Edit require that you change the file format to Plain Text. Higher-end programs like Open Office and MS Word may have different names for this, or not work at all. Even if the file is a .txt, if the file format itself isn't correct, Minecraft won't read it, and it'll just as if you didn't have a .mcmeta file at all!
The name of this .mcmeta must match the name of your animation's .png file EXACTLY! This is REALLY important, and is different from how the 1.5 format worked.
For a .mcmeta file, the extension must be after the ENTIRE file name of the image. For example "obsidian.png" gets a file called "obsidian.png.mcmeta", but with file extensions hidden you may actually have "obsidian.png.mcmeta.txt" and not even know it. This is why a lot of .mcmeta files fail, so please don't make this mistake.
IMPORTANT: MATCH YOUR FILE NAMES EXACTLY: I can NOT stress how important it is to be studious about matching your file names. Minecraft is a program, and like most programs, will not try to guess your intentions. Just as you must match file names exactly if you want Minecraft to figure out which texture in a pack it's supposed to call, the .mcmeta file accompanying your animation's file must also match exactly. Capitalization, underscores, and the .png in the middle are ALL IMPORTANT!
Every .mcmeta file MUST be in the same folder as the .png file that it goes with. If you're animating a block, it should be in /textures/blocks/. If you're animating an item, it goes in /textures/items/.
The Basic Setup:
At it's most basic, the .mcmeta file will contain an instruction that let's Minecraft know that this is supposed to be an animation file. This is important as Minecraft has multiple types of .mcmeta files, and it is important the Minecraft knows which is supposed to do what. The obvious comparison is to the pack.mcmeta which is in the root of your resource pack. That file has a different, though similar, setup to an animation's .mcmeta
At it's most basic, an animation's .mcmeta will look like this:
{ "animation": { } }
With this setup, the animation will run from the first frame to the last frame, at the rate of 20 frames per second. This is the default behavior for all Minecraft block and item animations. To learn to change this, see the sections below.
Unlike in the 1.5 setup, you can not simply leave a .mcmeta file blank and expect that it is going to work.
Adjusting Framerate:
Not all animations are designed to run at a rate of 20 fps. You can adjust the rate an animation moves very easily in the 1.6 .mcmeta format. This is one of the big advantages of the new format, in that you can adjust timing without having to list every frame individually, saving a lot of time.
First, start with the basic setup shown above:
{ "animation": { } }
See the set of brackets after "animation":? That's where we're going to put our timing information. Add the following in between those brackets:
"frametime": 4
The entire thing together should look like this:
{ "animation": {
"frametime": 4
} }
Tip: Spacing Doesn't Matter:One thing that confuses people is the way that Dinnerbone's Texture Ender lays out the animation files. They wonder if the text needs to be laid out like that. The answer is "No, it doesn't". In many of these examples, I'll have the text layed out in an outline style to make it easier to read. This is totally unnecessary as everything can be put into a single line. For example, the above animation can be in three lines like it is above, or a single line like this: { "animation": { "frametime": 4 } } Both versions will work without issue.
Here are a couple of examples of how this will work with your animation:
This red animation uses the default timing of 1 frame per tick (20 frames per second). Notice how quickly it moves?
This blue animation, on the other hand, uses the frametime attribute to slow the animation down to 1 frame per 20 ticks (1 frame per second). See how it moves much slower? When adjusting frametime (or an individual frame's "time" attribute as shown below) higher numbers are slower and smaller numbers are faster. Keep in mind that 1 frame per tick is as fast as an animation will go, and you can only use whole numbers.
Changing Frame Order:
Going back to the first example, the yellow numbered block, you can see that frames are in order starting with frame number 0. What do you do if you want to change the order of these frames, or use a singe frame more than once in the course of an animation? Well, you could make a very long animation strip that has redundant frames... but that's very wasteful and will use up a LOT of memory needlessly. That would be a bad idea.
Instead, we can use the .mcmeta file to adjust the order of the frames. Here's an example:
By using these six frames, numbered 0 - 5, we can make an animation that fills the bar and then depletes it without having to actually animate the second half of the animation.
To adjust frame order, we'll need to add a new attribute where "frametime": was added in the previous section. This one is called "frames":, and is significantly more complicated.
Again, start with the basic setup, and add the following in the brackets after "animation":
"frames": [ ]
IMPORTANT: CHECK YOUR BRACKETS: It's important to note that for most things in these .mcmeta files, you'll be using curved brackets like these: { }. However, for the Frames attribute, you'll need to use square brackets like these: [ ]. Getting this one little detail wrong will cause Minecraft to disregard your .mcmeta file, and give you checkerboard blocks.
After you've added that, your .mcmeta file should look like this:
{ "animation": {
"frames": [ ] } }
This alone will not do anything. You must actually list the frames in the order that you want them to appear, separated by commas. Here's our green-block example:
Tip: Watch the Ends: In the above example, notice how I don't end the sequence with 0? This is because the animation repeats starting with the beginning. If there were a 0 at each end, it would be in the sequence twice in a row and thus would display for double the amount of time. Be mindful of this if you cycling animations seem to hang on one frame. If you're having a problem, ask yourself "would this make sense if I put the exact same sequence of numbers in there twice?" If you answer "No, because a number would repeat without a good reason", then you have a redundant number at the end.
As you can see, the frames go in order starting with frame 0 until it get to the last frame of the strip (number 5), and then proceeds to decrease in number, running the frames backwards until it reaches 1. Here's the result in convenient animated format:
IMPORTANT: DO NOT GO BEYOND THE END OF THE STRIP!: What happens if you accidentally put a 6 after the five in that example? Well, there's no frame with that number in that strip (six frames means 0-5). This will most likely confuse Minecraft and cause the animation to fail. Remember that zero is your first number and that it counts as much as any other.
IMPORTANT: NO COMMA AFTER THE LAST NUMBER: An important thing to note is that there's no comma after the last 1 in that example. This is VERY important. The commas tell Minecraft that there's more to follow. By including a comma after the last frame, you're telling Minecraft that there's more frames... and then leaving it hanging. Minecraft is really picky when it comes to .mcmeta files, and adding that comma will cause the entire animation to fail, resulting in checkerboard blocks. Keep that in mind.
Adjusting Frame Delay:
Now you know how to change the speed that the animation runs, and how to change the order in which the frames are presented. But what happens if you want a single frame to be visible for a different amount of time than the rest of the animation? Well, you could list it multiple times in a row to drag it out... but that doesn't work if you want to make one faster.
Instead, you can use your handy .mcmeta file to adjust the timing of a single frame.
For starters, you will need to have your frames laid out in the same manner as above, with them listed in the order you want them to be displayed. You must do this even if you want them to run in the default order.
Now that you've gotten that far, replace the frame number that you want with the following bit of code:
{ "index": 3, "time": 20 }
The number following "Index": is which frame of the animation strip you want it to display. This is basically the same thing you learned to do in the last section, but in a longhand variation. Obviously the number following "time": is how many ticks (1/20 second incriments) you want that frame to be displayed for.
So for this example, we want the animation to run in the default order, at the default speed... except for frame #3 which we want to stick around for a full second. The .mcmeta file would now look like this:
Notice that there's a comma after the bracket surrounding the index and time attributes. Effectively, everything between those two brackets is just replacing the number. This also means that if you're adjusting the last frame in this method, you will NOT have a comma after the bracket.
Putting It All Together:
As you can see, by adding various things to the basic setup you can adjust anything that you want to with your animation. You can make it run faster or slower, have the frames run in a different order than they are in your animation strip, re-use frames multiple times, and adjust the timing of an individual frame.
But can you do them all in the same .mcmeta file? YES! Actually, you can! Here's an example of that:
In this example the animation runs at a rate of 10 frames per second (one frame every 2 ticks). The first frame, numbered zero, stays visible for two seconds. After that frame, the animation runs in order from frame 1 to frame five, where it runs in reverse skipping every other frame.
With these few basics, you can make animations WAY more complicated than this, but this is as far as we'll go for this tutorial. If you have any questions, don't be affraid to post!
3. Flowing Liquids:
While most animations follow the above format and rules, there are a few exceptions. The two biggest are Flowing water and lava. These two files follow a special set of rules when it comes to laying out your animation sheet. Don't worry, once you understand them they're pretty easy. It's just a few extra steps.
IMPORTANT: FLOWING LIQUIDS ONLY: This only applies to water_flow.png and lava_flow.png (and presumably other mod-added liquids). The still water and lava files follow the same format as any other block, as outlined above. Do NOT do the stuff in this section with your still liquids. It will end up looking really weird.
To make a flowing liquid animation, start by making your frames the same way you would any other animation. Don't organize them into strips like normal, though. Instead, take each frame and repeat it in a 2 by 2 block. This will make each frame in a flowing liquid animation twice the normal resolution of your texture pack. Don't worry, this is normal and won't affect the look of your pack at all.
Once you've done that, then you organize them into strips as shown above.
Here's a graphical representation of this:
This will also help you if you're converting your flowing water/lava animations from the pre-1.5 MCPatcher/Optifine format to the new Minecraft flowing liquid animation format.
Tip: Why the Double Tile?:If you're wondering the reason why the flowing liquid animations are different, it's because of how Minecraft renders the water textures. Flowing water tiles are placed in the middle of the 2x2 area. This saves Minecraft from having to tile the texture in real time. If your animation looks different than expected, remember that the tile is actually in the middle of your frame, and not lined up with the single tile in the corner. A 25% offset is required to fix this if it's an issue.
When making the .txt file for these animations, remember that your frames are now twice as large as they normally would be. When you go to figure out the number of frames you have, remember to divide both dimensions of your animation strip by 2 to get your 'real' resolution.
4. Clock and Compass:
These two items actually cannot be animated at all, but they're laid out in a similar way so I'm including them in this tutorial.
Instead of being animated in the way we normally think of, the animations for the clock and compass are driven by an in-game factor. In the case of the clock, it's the time of in-game day. For the compass, it's the player's position and orientation in relation to the center of spawn.
Because these animations are key-driven, we need to set up our animation frames in the order that Minecraft wants us to, rather than being able to rely on a .txt file to fix things for us... althoug we still need one for Minecraft to recognize the file properly.
IMPORTANT: YOU STILL NEED A .mcmeta FILE: You will still need to include a .mcmeta file for both the clock and compass in the /textures/items/ folder along side their respective .png files. If you don't, Minecraft won't recognize these textures since they aren't square. Just use the basic setup from the Understanding .mcmeta Files section, since there's nothing you can do to adjust these two items anyway.
Clock
The clock "animation" can have any number of frames. Minecraft will decide which frame to display by dividing the time by the number of available frames, so you needn't worry about doing the math yourself.
The order of the frames is very important, and there's no way to change them.
The top frame of your animation should be mid-day with the sun at it's apex. That is, noon. Each frame below it should be advancing the time. This is clockwise motion, if you're making an analogue clock. About half-way down the animation should be midnight, and the last frame should be almost noon again.
Tip: That last frame:Note that I said ALMOST noon. It should be just before that since noon itself is represented by your first frame. Remember, you don't want a frame repeated twice!
Here's a simple example:
Note the basic clockwise motion of the blue dot. Having it at the top of the circle represents noon, while at the exact bottom it represents midnight. It then returns to the top along the other side. However you choose to have your animation represent time, have it follow this same basic movement.
Compass
With the compass, the top frame should be with spawn directly at the player's back. If you're animating a traditional style of compass, this would be with the needle pointing strait down.
On a traditional compass (like the one used in vanilla) the needle progresses in a clockwise direction as you move down the animation strip. Half-way through the animation it should be pointing with spawn directly in front of the player. It then proceeds down the opposite side of the circle, still in a clockwise movement. The last frame should be nearly at the player's back again, although slightly to the player's right.
Tip: That last frame... again:Again, be mindful not to have to top and bottom frames of your compass sequence be the same lest it confuse players using your texture pack. Only the top frame should have the player facing directly away from the spawn. The bottom frame should be slightly off center.
Here's a simple example of this:
Note where the red dot starts (at the bottom), and the general flow of its movement in a clockwise fashion ending up nearly back at it's starting position in the last frame. These are the important things.
As always, you don't have to represent your compass in this fashion, but make your version represents the same movement.
As with the clock, you don't have to have a specific number of frames. The game will divide your frames evenly among the 360° of rotation a player can be standing at.
5. Download Some Examples:
Still a little confused? Want more practical examples? How about something pre-made that you can experament on without worrying about wrecking your own stuff? Well, here you go!
DOWNLOAD (For the rules stickers: This "Pack" is released under the "Do Whatever You Want With It Because I Didn't Spend Enough Time On It To Care™" license.
This 16x16 pack has animations for: Wool (white, yellow, purple, blue, green, red, and black), Water (both still and flowing), and the Clock and Compass. The quality is extremely low (I threw it together in a few hours), but they're just there as examples so don't worry/complain about it.
6. Trouble Shooting:
Here are a list of common mistakes that I've seen people make. Before asking for help, be certain that you've gone through this list.
Make sure that what you're animating is a block or an item. Entities, mobs, GUIs, etc. cannot be animated with this method.
If you are using Optifine, make sure that Animations are enabled.
Windows Users: Make sure you have Windows set to show known file extensions. You may have a hidden .txt extension at the end that's throwing Minecraft off.
Make sure all of your brackets are of the correct type. Most brackets will be curved brackets ({ }), but the frame order uses squared brackets ([ ]).
Make sure you have opening and closing brackets. For every { there is a }. For every [ there is a ]. A common mistake is to have too many or too few brackets. Make sure to count them.
Do NOT put a comma after your last frame. If you're listing your frames for any reason, make sure not to put a comma after the last one.
Check the number of frames you've specified in your .mcmeta file. You MUST have only frames that actually exist. Remember that the count starts with "zero" so your last frame will be numbered one less than the total number of frames you have if you start counting with "one" like a normal human being. For example {17 total frames} = {frame 0 though frame 16}.
Make sure to put a comma between the "frametime": and "frames": attributes, but not after the second one. Again, a comma is your way of telling Minecraft that there's more to be looked at. If you put a comma and there's nothing more that Minecraft needs to look at, it will give up and cause the animation to fail.
Make sure your .mcmeta file is in 'UTF-8 without BOM' format. This should be automatic for most simple text editors, but not necessarily all.
If all else fails, try changing everything in your .mcmeta file to be a single line. Rarely, Minecraft will just not like the way you hit the enter key, and the file will be invalid as a result.
7. Any Questions?
If there's anything that you don't understand, want clarified, or just can't figure out feel free to post in this thread and someone (maybe even me) will try to help you out.
Please be clear about what you're having problems with. Saying "it's not working" doesn't help anyone to help you. Provide screenshots if possible. Also, be prepared to offer a download of the animation files that aren't working. Sometimes we just have to see what you've done in order to tell you what you did wrong.
Hopefully this thread helps some of you who are having problems with this new format out.
This is the main reason I made this tutorial. So many people are having problems understanding it. I'm hoping that this will help some people out. If nothing else, give me something to link to rather than re-explaining the same thing in a dozen different threads.
If I only knew that before... I typed every number from 0 to 63 4 times to get the delays right. Thanks for the updated guide though!
Ouch. That's brutal man. Sorry you had to go through that.
I wanted to type this earlier, but I wasn't sure on all of my information. Heck, I'm still not 100% sure on some things, so I'm just hoping the information isn't wrong. I wanted to do more testing but, well, I saw how much trouble people were having so I went ahead.
The Meaning of Life, the Universe, and Everything.
Join Date:
2/13/2013
Posts:
54
Location:
Hint: My steed is a wombat
Member Details
Thank you for this! I can now animate with ease. Previously I was having trouble adjusting to MCMETA but now I see how easy it actually is once one understands the format. :3
I'll use this information on the resource pack page in Minecraft Wiki. Can I?
Go for it!
I actually owe the Minecraft Wiki one since some of the info from my 1.5 animation tutorial came from there. Seems only fair that I'd be giving back a version later.
Love the tutorial =3 If only I had something like this when I was making animations in the early 1.5 era... that would have saved a lot of frustration with why my water and lava skipped, was off centered and broken ;_;
Though I still have to animate my clock.... urggh, can't be bothered to do that many animations =X I wish there was a utility to make it for you instead of having to painfully rotate a layer over and over again. It was hard enough with the compass, I almost fell asleep from how tedious and boring it was.
Rollback Post to RevisionRollBack
Wind Waker Texture Pack and for Pocket Edition! ~ Texture Pack Central - Large directory of Texture Packs!
Love the tutorial =3 If only I had something like this when I was making animations in the early 1.5 era... that would have saved a lot of frustration with why my water and lava skipped, was off centered and broken ;_;
I did write a tutorial for 1.5 you know. Not sure why you didn't see it.
Though I still have to animate my clock.... urggh, can't be bothered to do that many animations =X I wish there was a utility to make it for you instead of having to painfully rotate a layer over and over again. It was hard enough with the compass, I almost fell asleep from how tedious and boring it was.
Well, I suppose you could make something in the animation program of your choice to do it automatically. Hypothetically anything that can do any sort of animation (Flash, Blender, Maya, etc.) could be set up to render a simple rotation. Guess it just depends on what you have access to and know how to use.
I did write a tutorial for 1.5 you know. Not sure why you didn't see it.
Well, I suppose you could make something in the animation program of your choice to do it automatically. Hypothetically anything that can do any sort of animation (Flash, Blender, Maya, etc.) could be set up to render a simple rotation. Guess it just depends on what you have access to and know how to use.
Happy to be of service.
I did see it, though I did my animations really early before you posted it.. Of course I then finished it, came to check out what's going on and I see a tutorial @_@
But actually thanks for the idea to throw it into an animation program... I'm not really sure why I didn't think of that, especially when I have said programs xD
Rollback Post to RevisionRollBack
Wind Waker Texture Pack and for Pocket Edition! ~ Texture Pack Central - Large directory of Texture Packs!
I did see it, though I did my animations really early before you posted it.. Of course I then finished it, came to check out what's going on and I see a tutorial @_@
Ah, so you were working while I was still mistakenly thinking that helping people individually was an efficient way to go about spreading that knowledge.
But actually thanks for the idea to throw it into an animation program... I'm not really sure why I didn't think of that, especially when I have said programs xD
I've just tried to animate an entity texture (I thought the beacon beam would be really interesting if it pulsed) with no luck. I can make the same animation work on a block, so I assume entities just don't support animation. Can you confirm?
I've just tried to animate an entity texture (I thought the beacon beam would be really interesting if it pulsed) with no luck. I can make the same animation work on a block, so I assume entities just don't support animation. Can you confirm?
As far as vanilla animation goes, yes, I can confirm. The system Mojang has in place is specific to blocks and items only.
That said, try the MCPatcher animation method that's part of the ExtendedHD part of the mod. You can animate virtually everything in the game (including entities) with that mod, so I see no reason it wouldn't work on a beacon beam.
so the png and mcmet is named the same and is in the same folder but i still get the checked purple and black texture =(
I have also tried optifine and mcpatcher but non of those work either. WHY.i thaught the link takes from my comp but it dont an i dont know how to remove
Here's what you did wrong: You have "frames" set up for five frames, but left out the first one. I can almost hear you saying "But... I only have four frames in that." No... you have five. The numbering for animations always starts with zero, not one. So you have frames 0, 1, 2, 3, and 4... five frames in total. You just don't use the #0 frame in your lineup.
Since you don't actually have a frame #4 (four frames being 0 - 3), that's what's causing Minecraft to error. Do you understand?
Now... there are two ways to fix this. The first would be to change your frame lineup to only use the frames that you actually use. That would look like this:
The second would be to just get rid of the "frames" section altogether since you don't really need it. The only reasons to specify your frames are either to change the timing of a frame, or to change the order in which the frames appear. In this case, you've done neither of those, so you can get by with this:
{ "animation": { "frametime": 5 } }
It'll function no differently than the other fix will, and uses less complexity.
i thaught the link takes from my comp but it dont an i dont know how to remove
Why on earth would it do that? Minecraft Forum isn't an image hosting service. Get an account on imgur.com, upload your image there, an then click on it. It will show a variety of imbed codes. Copy-paste the code under "BBCode (message boards & forums)" into your forum posts. Then we'll be able to see it.
Only if sandstone_carved.png is an animated tile. Otherwise, no.
Animations always have to be accompanied by a .mcmeta file, but ordinary blocks never do. Make sense?
So, like, I have it set up but my Resource pack here is 32x32, but anyway, sandstone_carved.png is animated yes. But I tried sandstone_carved.png.mcmeta and I for some reason end up with the normal Chiseled Sandstone texture. But the texture isn't the purple black thing though. But I even edited the mc.meta file by typing in the animation thing and what not. Did everything you said here... D:
I have sandstone_carved.png.mcmeta setup like this:
{ "animation": { "frametime":4}}
I have six total frames(I started with zero yes), do I need to make it frametime:5?
If you're reading this thread, it's likely you're either having problems with the new block and item animation format introduced in Minecraft 1.6, or, are new to making animations for Minecraft and want to learn how with as few problems as possible.
Tip: Watch for Green Text: When I write tutorials, I add little tidbits in green text lines. These are often helpful hints or little extras. Keep an eye out for them, as they may prove helpful.
Tip: Look Familiar?: Look Familiar?: If a lot of this tutorial looks familiar, that's because it should be. A lot of this is copy-pasted directly from the previous tutorial: "Making Animated Blocks and Items: The Minecraft 1.5 Way!" If you read that tutorial, and are familiar with the concepts shown in it, scroll down to "Understanding .mcmeta Files" below. Thats' where the bulk of the 1.6 changes are mentioned. Also, if I missed a mention of a .txt file, please point that out so I can edit it. I tried to get everything right, but I'm not perfect.
IMPORTANT: THIS IS ONLY FOR BLOCKS AND ITEMS: If you're trying to animate anything that is not a block or an item (including blocks whose textures are in the /entity/ folder which are rendered as entities and not blocks) you'll need to use MCPatcher and its animation format.
1. The Animation Strip Format:
The basic format of an animation is a column of frames. Each individual frame should be the same width and height as the texture you're attempting to animate. For example, if your texture pack is 16x16, each frame in the column should also be 16x16.
Tip: I'm working in 16x16: In all of the examples on this thread, all of the frames are supposed to be at 16x16 resolution. While some, like the image above, are kept at their native resolution (to save on scrolling), I've optimized most of the images for maximum visibility. Don't let this confuse you later on.
In this example, each frame is numbered so you can see its position in the stack. Animated in-game, it will look something like this:
Tip: Starting With Zero: Why is the top frame of an animations strip numbered 0? Because a programmer made the system. In the minds of programmers, zero is the first number in a sequence, preceding the number one. It takes us artsy types a little bit of practice to get use to starting a count with zero, but that's just how computers (or at least computer programmers) work so we'll just have to deal with it.
2. Understanding .mcmeta files:
Every animation in Minecraft must have an accompanying .mcmeta file with it. If it doesn't, Minecraft won't properly read the animation file, and you'll get something that looks like this in game:
Obviously, this is undesirable.
IMPORTANT: READ THE SPOILER ASSOCIATED WITH YOUR OPERATING SYSTEM: Certain operating Systems have behaviors that may prevent you from changing your file extensions easily. If you don't change your files properly, you will have files that have a hidden .txt extension at the end, which will cause Minecraft to ignore your file, believing that it is not a .mcmeta file. For example, you should have "obsidian.png.mcmeta", but with file extensions hidden you may actually have "obsidian.png.mcmeta.TXT" and not even know it. This is why a lot of .mcmeta file fail, so please don't make this mistake.
You can find instructions on how to do it by following This Link.
Once the file extension is visble, it should be able to be changed without issue. Ignore the warning dialogue about the file becoming corrupted. Trust me, it won't.
IMPORTANT: SAVE AS PLAIN TEXT: The simpler the the text editor you use to make these files, the better. Programs like Notepad and Notepad++, which have no text formatting, are best. Other programs, like Window's Wordpad and Mac's Text Edit require that you change the file format to Plain Text. Higher-end programs like Open Office and MS Word may have different names for this, or not work at all. Even if the file is a .txt, if the file format itself isn't correct, Minecraft won't read it, and it'll just as if you didn't have a .mcmeta file at all!
The name of this .mcmeta must match the name of your animation's .png file EXACTLY! This is REALLY important, and is different from how the 1.5 format worked.
For a .mcmeta file, the extension must be after the ENTIRE file name of the image. For example "obsidian.png" gets a file called "obsidian.png.mcmeta", but with file extensions hidden you may actually have "obsidian.png.mcmeta.txt" and not even know it. This is why a lot of .mcmeta files fail, so please don't make this mistake.
IMPORTANT: MATCH YOUR FILE NAMES EXACTLY: I can NOT stress how important it is to be studious about matching your file names. Minecraft is a program, and like most programs, will not try to guess your intentions. Just as you must match file names exactly if you want Minecraft to figure out which texture in a pack it's supposed to call, the .mcmeta file accompanying your animation's file must also match exactly. Capitalization, underscores, and the .png in the middle are ALL IMPORTANT!
Every .mcmeta file MUST be in the same folder as the .png file that it goes with. If you're animating a block, it should be in /textures/blocks/. If you're animating an item, it goes in /textures/items/.
The Basic Setup:
At it's most basic, the .mcmeta file will contain an instruction that let's Minecraft know that this is supposed to be an animation file. This is important as Minecraft has multiple types of .mcmeta files, and it is important the Minecraft knows which is supposed to do what. The obvious comparison is to the pack.mcmeta which is in the root of your resource pack. That file has a different, though similar, setup to an animation's .mcmeta
At it's most basic, an animation's .mcmeta will look like this:
With this setup, the animation will run from the first frame to the last frame, at the rate of 20 frames per second. This is the default behavior for all Minecraft block and item animations. To learn to change this, see the sections below.
Unlike in the 1.5 setup, you can not simply leave a .mcmeta file blank and expect that it is going to work.
Adjusting Framerate:
Not all animations are designed to run at a rate of 20 fps. You can adjust the rate an animation moves very easily in the 1.6 .mcmeta format. This is one of the big advantages of the new format, in that you can adjust timing without having to list every frame individually, saving a lot of time.
First, start with the basic setup shown above:
See the set of brackets after "animation":? That's where we're going to put our timing information. Add the following in between those brackets:
The entire thing together should look like this:
Tip: Spacing Doesn't Matter: One thing that confuses people is the way that Dinnerbone's Texture Ender lays out the animation files. They wonder if the text needs to be laid out like that. The answer is "No, it doesn't". In many of these examples, I'll have the text layed out in an outline style to make it easier to read. This is totally unnecessary as everything can be put into a single line. For example, the above animation can be in three lines like it is above, or a single line like this: { "animation": { "frametime": 4 } } Both versions will work without issue.
Here are a couple of examples of how this will work with your animation:
This red animation uses the default timing of 1 frame per tick (20 frames per second). Notice how quickly it moves?
This blue animation, on the other hand, uses the frametime attribute to slow the animation down to 1 frame per 20 ticks (1 frame per second). See how it moves much slower? When adjusting frametime (or an individual frame's "time" attribute as shown below) higher numbers are slower and smaller numbers are faster. Keep in mind that 1 frame per tick is as fast as an animation will go, and you can only use whole numbers.
Changing Frame Order:
Going back to the first example, the yellow numbered block, you can see that frames are in order starting with frame number 0. What do you do if you want to change the order of these frames, or use a singe frame more than once in the course of an animation? Well, you could make a very long animation strip that has redundant frames... but that's very wasteful and will use up a LOT of memory needlessly. That would be a bad idea.
Instead, we can use the .mcmeta file to adjust the order of the frames. Here's an example:
By using these six frames, numbered 0 - 5, we can make an animation that fills the bar and then depletes it without having to actually animate the second half of the animation.
To adjust frame order, we'll need to add a new attribute where "frametime": was added in the previous section. This one is called "frames":, and is significantly more complicated.
Again, start with the basic setup, and add the following in the brackets after "animation":
IMPORTANT: CHECK YOUR BRACKETS: It's important to note that for most things in these .mcmeta files, you'll be using curved brackets like these: { }. However, for the Frames attribute, you'll need to use square brackets like these: [ ]. Getting this one little detail wrong will cause Minecraft to disregard your .mcmeta file, and give you checkerboard blocks.
After you've added that, your .mcmeta file should look like this:
This alone will not do anything. You must actually list the frames in the order that you want them to appear, separated by commas. Here's our green-block example:
Tip: Watch the Ends: In the above example, notice how I don't end the sequence with 0? This is because the animation repeats starting with the beginning. If there were a 0 at each end, it would be in the sequence twice in a row and thus would display for double the amount of time. Be mindful of this if you cycling animations seem to hang on one frame. If you're having a problem, ask yourself "would this make sense if I put the exact same sequence of numbers in there twice?" If you answer "No, because a number would repeat without a good reason", then you have a redundant number at the end.
As you can see, the frames go in order starting with frame 0 until it get to the last frame of the strip (number 5), and then proceeds to decrease in number, running the frames backwards until it reaches 1. Here's the result in convenient animated format:
IMPORTANT: DO NOT GO BEYOND THE END OF THE STRIP!: What happens if you accidentally put a 6 after the five in that example? Well, there's no frame with that number in that strip (six frames means 0-5). This will most likely confuse Minecraft and cause the animation to fail. Remember that zero is your first number and that it counts as much as any other.
IMPORTANT: NO COMMA AFTER THE LAST NUMBER: An important thing to note is that there's no comma after the last 1 in that example. This is VERY important. The commas tell Minecraft that there's more to follow. By including a comma after the last frame, you're telling Minecraft that there's more frames... and then leaving it hanging. Minecraft is really picky when it comes to .mcmeta files, and adding that comma will cause the entire animation to fail, resulting in checkerboard blocks. Keep that in mind.
Adjusting Frame Delay:
Now you know how to change the speed that the animation runs, and how to change the order in which the frames are presented. But what happens if you want a single frame to be visible for a different amount of time than the rest of the animation? Well, you could list it multiple times in a row to drag it out... but that doesn't work if you want to make one faster.
Instead, you can use your handy .mcmeta file to adjust the timing of a single frame.
For starters, you will need to have your frames laid out in the same manner as above, with them listed in the order you want them to be displayed. You must do this even if you want them to run in the default order.
Now that you've gotten that far, replace the frame number that you want with the following bit of code:
The number following "Index": is which frame of the animation strip you want it to display. This is basically the same thing you learned to do in the last section, but in a longhand variation. Obviously the number following "time": is how many ticks (1/20 second incriments) you want that frame to be displayed for.
So for this example, we want the animation to run in the default order, at the default speed... except for frame #3 which we want to stick around for a full second. The .mcmeta file would now look like this:
Notice that there's a comma after the bracket surrounding the index and time attributes. Effectively, everything between those two brackets is just replacing the number. This also means that if you're adjusting the last frame in this method, you will NOT have a comma after the bracket.
Putting It All Together:
As you can see, by adding various things to the basic setup you can adjust anything that you want to with your animation. You can make it run faster or slower, have the frames run in a different order than they are in your animation strip, re-use frames multiple times, and adjust the timing of an individual frame.
But can you do them all in the same .mcmeta file? YES! Actually, you can! Here's an example of that:
{ "animation": { "frametime": 2, "frames": [ { "index": 0, "time": 40 }, 1, 2, 3, 4, 5, 6, 4, 2 ] } }
In this example the animation runs at a rate of 10 frames per second (one frame every 2 ticks). The first frame, numbered zero, stays visible for two seconds. After that frame, the animation runs in order from frame 1 to frame five, where it runs in reverse skipping every other frame.
With these few basics, you can make animations WAY more complicated than this, but this is as far as we'll go for this tutorial. If you have any questions, don't be affraid to post!
3. Flowing Liquids:
While most animations follow the above format and rules, there are a few exceptions. The two biggest are Flowing water and lava. These two files follow a special set of rules when it comes to laying out your animation sheet. Don't worry, once you understand them they're pretty easy. It's just a few extra steps.
IMPORTANT: FLOWING LIQUIDS ONLY: This only applies to water_flow.png and lava_flow.png (and presumably other mod-added liquids). The still water and lava files follow the same format as any other block, as outlined above. Do NOT do the stuff in this section with your still liquids. It will end up looking really weird.
To make a flowing liquid animation, start by making your frames the same way you would any other animation. Don't organize them into strips like normal, though. Instead, take each frame and repeat it in a 2 by 2 block. This will make each frame in a flowing liquid animation twice the normal resolution of your texture pack. Don't worry, this is normal and won't affect the look of your pack at all.
Once you've done that, then you organize them into strips as shown above.
Here's a graphical representation of this:
This will also help you if you're converting your flowing water/lava animations from the pre-1.5 MCPatcher/Optifine format to the new Minecraft flowing liquid animation format.
Tip: Why the Double Tile?: If you're wondering the reason why the flowing liquid animations are different, it's because of how Minecraft renders the water textures. Flowing water tiles are placed in the middle of the 2x2 area. This saves Minecraft from having to tile the texture in real time. If your animation looks different than expected, remember that the tile is actually in the middle of your frame, and not lined up with the single tile in the corner. A 25% offset is required to fix this if it's an issue.
When making the .txt file for these animations, remember that your frames are now twice as large as they normally would be. When you go to figure out the number of frames you have, remember to divide both dimensions of your animation strip by 2 to get your 'real' resolution.
4. Clock and Compass:
These two items actually cannot be animated at all, but they're laid out in a similar way so I'm including them in this tutorial.
Instead of being animated in the way we normally think of, the animations for the clock and compass are driven by an in-game factor. In the case of the clock, it's the time of in-game day. For the compass, it's the player's position and orientation in relation to the center of spawn.
Because these animations are key-driven, we need to set up our animation frames in the order that Minecraft wants us to, rather than being able to rely on a .txt file to fix things for us... althoug we still need one for Minecraft to recognize the file properly.
IMPORTANT: YOU STILL NEED A .mcmeta FILE: You will still need to include a .mcmeta file for both the clock and compass in the /textures/items/ folder along side their respective .png files. If you don't, Minecraft won't recognize these textures since they aren't square. Just use the basic setup from the Understanding .mcmeta Files section, since there's nothing you can do to adjust these two items anyway.
Clock
The clock "animation" can have any number of frames. Minecraft will decide which frame to display by dividing the time by the number of available frames, so you needn't worry about doing the math yourself.
The order of the frames is very important, and there's no way to change them.
The top frame of your animation should be mid-day with the sun at it's apex. That is, noon. Each frame below it should be advancing the time. This is clockwise motion, if you're making an analogue clock. About half-way down the animation should be midnight, and the last frame should be almost noon again.
Tip: That last frame: Note that I said ALMOST noon. It should be just before that since noon itself is represented by your first frame. Remember, you don't want a frame repeated twice!
Here's a simple example:
Note the basic clockwise motion of the blue dot. Having it at the top of the circle represents noon, while at the exact bottom it represents midnight. It then returns to the top along the other side. However you choose to have your animation represent time, have it follow this same basic movement.
Compass
With the compass, the top frame should be with spawn directly at the player's back. If you're animating a traditional style of compass, this would be with the needle pointing strait down.
On a traditional compass (like the one used in vanilla) the needle progresses in a clockwise direction as you move down the animation strip. Half-way through the animation it should be pointing with spawn directly in front of the player. It then proceeds down the opposite side of the circle, still in a clockwise movement. The last frame should be nearly at the player's back again, although slightly to the player's right.
Tip: That last frame... again: Again, be mindful not to have to top and bottom frames of your compass sequence be the same lest it confuse players using your texture pack. Only the top frame should have the player facing directly away from the spawn. The bottom frame should be slightly off center.
Here's a simple example of this:
Note where the red dot starts (at the bottom), and the general flow of its movement in a clockwise fashion ending up nearly back at it's starting position in the last frame. These are the important things.
As always, you don't have to represent your compass in this fashion, but make your version represents the same movement.
As with the clock, you don't have to have a specific number of frames. The game will divide your frames evenly among the 360° of rotation a player can be standing at.
5. Download Some Examples:
Still a little confused? Want more practical examples? How about something pre-made that you can experament on without worrying about wrecking your own stuff? Well, here you go!
DOWNLOAD
(For the rules stickers: This "Pack" is released under the "Do Whatever You Want With It Because I Didn't Spend Enough Time On It To Care™" license.
This 16x16 pack has animations for: Wool (white, yellow, purple, blue, green, red, and black), Water (both still and flowing), and the Clock and Compass. The quality is extremely low (I threw it together in a few hours), but they're just there as examples so don't worry/complain about it.
6. Trouble Shooting:
Here are a list of common mistakes that I've seen people make. Before asking for help, be certain that you've gone through this list.
7. Any Questions?
If there's anything that you don't understand, want clarified, or just can't figure out feel free to post in this thread and someone (maybe even me) will try to help you out.
Please be clear about what you're having problems with. Saying "it's not working" doesn't help anyone to help you. Provide screenshots if possible. Also, be prepared to offer a download of the animation files that aren't working. Sometimes we just have to see what you've done in order to tell you what you did wrong.
Hopefully this thread helps some of you who are having problems with this new format out.
Great clarity on the way the mcmeta works.
Thanks!
This is the main reason I made this tutorial. So many people are having problems understanding it. I'm hoping that this will help some people out. If nothing else, give me something to link to rather than re-explaining the same thing in a dozen different threads.
I wanted to type this earlier, but I wasn't sure on all of my information. Heck, I'm still not 100% sure on some things, so I'm just hoping the information isn't wrong. I wanted to do more testing but, well, I saw how much trouble people were having so I went ahead.
Why is it whenever I make these long tutorial posts the stupid editor inserts a bunch of junk everywhere.
Thanks for pointing those out. Let me know if I missed any.
(This is how rumors on forums start you know.)
I actually owe the Minecraft Wiki one since some of the info from my 1.5 animation tutorial came from there. Seems only fair that I'd be giving back a version later.
Though I still have to animate my clock.... urggh, can't be bothered to do that many animations =X I wish there was a utility to make it for you instead of having to painfully rotate a layer over and over again. It was hard enough with the compass, I almost fell asleep from how tedious and boring it was.
Well, I suppose you could make something in the animation program of your choice to do it automatically. Hypothetically anything that can do any sort of animation (Flash, Blender, Maya, etc.) could be set up to render a simple rotation. Guess it just depends on what you have access to and know how to use.
Happy to be of service.
I did see it, though I did my animations really early before you posted it.. Of course I then finished it, came to check out what's going on and I see a tutorial @_@
But actually thanks for the idea to throw it into an animation program... I'm not really sure why I didn't think of that, especially when I have said programs xD
You're Welcome!
I've just tried to animate an entity texture (I thought the beacon beam would be really interesting if it pulsed) with no luck. I can make the same animation work on a block, so I assume entities just don't support animation. Can you confirm?
As far as vanilla animation goes, yes, I can confirm. The system Mojang has in place is specific to blocks and items only.
That said, try the MCPatcher animation method that's part of the ExtendedHD part of the mod. You can animate virtually everything in the game (including entities) with that mod, so I see no reason it wouldn't work on a beacon beam.
Hope that helps you.
Thanks again! At the moment I'm trying to make an adventure map that only requires a resource pack, but thanks for the info.
{
"animation": {
"frametime": 5,
"frames": [
1,
2,
3,
4
]
}
}
so the png and mcmet is named the same and is in the same folder but i still get the checked purple and black texture =(
I have also tried optifine and mcpatcher but non of those work either. WHY.i thaught the link takes from my comp but it dont an i dont know how to remove
Here's what you did wrong: You have "frames" set up for five frames, but left out the first one. I can almost hear you saying "But... I only have four frames in that." No... you have five. The numbering for animations always starts with zero, not one. So you have frames 0, 1, 2, 3, and 4... five frames in total. You just don't use the #0 frame in your lineup.
Since you don't actually have a frame #4 (four frames being 0 - 3), that's what's causing Minecraft to error. Do you understand?
Now... there are two ways to fix this. The first would be to change your frame lineup to only use the frames that you actually use. That would look like this:
The second would be to just get rid of the "frames" section altogether since you don't really need it. The only reasons to specify your frames are either to change the timing of a frame, or to change the order in which the frames appear. In this case, you've done neither of those, so you can get by with this:
It'll function no differently than the other fix will, and uses less complexity.
Why on earth would it do that? Minecraft Forum isn't an image hosting service. Get an account on imgur.com, upload your image there, an then click on it. It will show a variety of imbed codes. Copy-paste the code under "BBCode (message boards & forums)" into your forum posts. Then we'll be able to see it.
Hope all of that helped you!
"Wake me, when you need me."
Animations always have to be accompanied by a .mcmeta file, but ordinary blocks never do. Make sense?
So, like, I have it set up but my Resource pack here is 32x32, but anyway, sandstone_carved.png is animated yes. But I tried sandstone_carved.png.mcmeta and I for some reason end up with the normal Chiseled Sandstone texture. But the texture isn't the purple black thing though. But I even edited the mc.meta file by typing in the animation thing and what not. Did everything you said here... D:
I have sandstone_carved.png.mcmeta setup like this:
{ "animation": { "frametime":4}}
I have six total frames(I started with zero yes), do I need to make it frametime:5?
"Wake me, when you need me."