loawkise Posted June 20, 2014 Share Posted June 20, 2014 Hi, I want to animate a mob texture that I have, but I can't get it working using the .mcmeta file. I am not sure if I am doing it wrong or it has changed. Here is my file file: { "animation": { "frames" [0,1] }} The name of the file is the same as my texture, but my texture is for a custom mob model so I was wondering if it was anything to do with specifying the texture size within the model class. Quote Link to comment Share on other sites More sharing options...
jabelar Posted June 20, 2014 Share Posted June 20, 2014 A custom mod will have a model class and also a renderer class. The renderer class is the one that associates the textures to the model. I think you would do your texture animation there. You probably don't even have to use meta data, but can control the change in texture any way you wish (use counter to cycle through), or use some state variable (for example wolf entities change the texture to blue eyes when isTamed() is true). Quote Check out my tutorials here: http://jabelarminecraft.blogspot.com/ Link to comment Share on other sites More sharing options...
loawkise Posted June 20, 2014 Author Share Posted June 20, 2014 Okay, I think I implemented something like you said, but it doesn't seem to change the texture and I am not sure if it is a programming error or I am missing something. @SideOnly(Side.CLIENT) public class RenderEntityGuardianStoneInfusedLava extends RenderLiving { private static ResourceLocation textures = new ResourceLocation(LivingBlocks.MODID + ":" + "textures/entity/livingblocks/entity_guardian_stone_infused_lava_0.png"); private static final String __OBFID = "CL_00000984"; public void textureAnimation() { int i; i = 0; if(i == 0) { textures = new ResourceLocation(LivingBlocks.MODID + ":" + "textures/entity/livingblocks/entity_guardian_stone_infused_lava_0.png"); i++; } if(i == 1) { textures = new ResourceLocation(LivingBlocks.MODID + ":" + "textures/entity/livingblocks/entity_guardian_stone_infused_lava_1.png"); i++; } if(i == 2) { textures = new ResourceLocation(LivingBlocks.MODID + ":" + "textures/entity/livingblocks/entity_guardian_stone_infused_lava_2.png"); i++; } if(i == 3) { textures = new ResourceLocation(LivingBlocks.MODID + ":" + "textures/entity/livingblocks/entity_guardian_stone_infused_lava_3.png"); i++; } if(i == 4) { textures = new ResourceLocation(LivingBlocks.MODID + ":" + "textures/entity/livingblocks/entity_guardian_stone_infused_lava_4.png"); i++; } if(i == 5) { textures = new ResourceLocation(LivingBlocks.MODID + ":" + "textures/entity/livingblocks/entity_guardian_stone_infused_lava_5.png"); i = 0; } System.out.println(i); } public RenderEntityGuardianStoneInfusedLava(ModelBase par1ModelBase, float par2) { super(par1ModelBase, par2); } protected ResourceLocation getEntityTexture(EntityGuardianStoneInfusedLava par1EntityGuardianStoneInfusedLava) { textureAnimation(); return textures; } protected ResourceLocation getEntityTexture(Entity par1Entity) { return this.getEntityTexture((EntityGuardianStoneInfusedLava)par1Entity); } } Quote Link to comment Share on other sites More sharing options...
loawkise Posted June 22, 2014 Author Share Posted June 22, 2014 Anyone have any ideas? Quote Link to comment Share on other sites More sharing options...
sarydactl Posted June 22, 2014 Share Posted June 22, 2014 Make sure your metamc file is not a txt file. When you go to properties it should NOT tell you txt. Even if you save it properly, it will still convert it to txt, so be sure to go back and convert it yourself. Other than that, I believe animations require 32 frames, but I might be wrong. Beyond that, I think the code is only pulling a texture, but won't update a texture. Consider using another Event to control it/tick it and see how far you get there. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.