I want to make my zangetsu behave like a bow but at the same time be a sword (only texture though as far as bow, that and projectile wise) so far I have a projectile that you can charge and if you decide not to finish charging it will remain in the blade causing more power for the blade. So my question is how do I make the sword change texture when my timer goes down?
This thread asks about getting the icon based on how long the item has been in use. diesieben07 says:
For the texture animation: There is a getIcon method that gives you the use-progress (how long the player has been holding right click basically) so you can return the appropriate Icon.
Pretty sure you can check other info, like the NBT tag for the sword's "charge" amount, etc. Also check this thread for another type of animation trigger.
Rollback Post to RevisionRollBack
Click this banner for a list of illegal mod distributors -- only download from legal sites!
This thread asks about getting the icon based on how long the item has been in use. diesieben07 says:
Pretty sure you can check other info, like the NBT tag for the sword's "charge" amount, etc. Also check this thread for another type of animation trigger.
um I have the getIcon method the problem is now that when I try to use it with the timer it just doesnt give a texture at all. I think im doing something wrong in either getIcon or stating the images itself.
For one, you're using a class field. Bad idea for an item because there is only ever one instance of that item. See this post about using NBT data instead (which is unique for each itemstack).
Secondly, I noticed your registerIcons uses this.getIconString(), but I did not see where you set the unlocalized name or texture name. Double-check that they are registered as "zangetsu" for both.
Does the console not warn you about missing textures? If it does it says where it is expecting to find them...
Rollback Post to RevisionRollBack
Click this banner for a list of illegal mod distributors -- only download from legal sites!
For one, you're using a class field. Bad idea for an item because there is only ever one instance of that item. See this post about using NBT data instead (which is unique for each itemstack).
Secondly, I noticed your registerIcons uses this.getIconString(), but I did not see where you set the unlocalized name or texture name. Double-check that they are registered as "zangetsu" for both.
Does the console not warn you about missing textures? If it does it says where it is expecting to find them...
I set the unlocalized name in the items class. Texture name I dont have.
If you don't set a texture name, getIconString() will not return the correct value and therefore your icons will not be registered correctly. Use this.setTextureName(MODID + ":zangetsu") in the constructor where MODID is your mod's id.
Rollback Post to RevisionRollBack
Click this banner for a list of illegal mod distributors -- only download from legal sites!
I want to make my zangetsu behave like a bow but at the same time be a sword (only texture though as far as bow, that and projectile wise) so far I have a projectile that you can charge and if you decide not to finish charging it will remain in the blade causing more power for the blade. So my question is how do I make the sword change texture when my timer goes down?
here is my code
https://gist.github.com/pedobearisawesome/206e593123bbde9b816b
This thread asks about getting the icon based on how long the item has been in use. diesieben07 says:
Pretty sure you can check other info, like the NBT tag for the sword's "charge" amount, etc. Also check this thread for another type of animation trigger.
um I have the getIcon method the problem is now that when I try to use it with the timer it just doesnt give a texture at all. I think im doing something wrong in either getIcon or stating the images itself.
For one, you're using a class field. Bad idea for an item because there is only ever one instance of that item. See this post about using NBT data instead (which is unique for each itemstack).
Secondly, I noticed your registerIcons uses this.getIconString(), but I did not see where you set the unlocalized name or texture name. Double-check that they are registered as "zangetsu" for both.
Does the console not warn you about missing textures? If it does it says where it is expecting to find them...
oh okay thanks!
I set the unlocalized name in the items class. Texture name I dont have.
If you don't set a texture name, getIconString() will not return the correct value and therefore your icons will not be registered correctly. Use this.setTextureName(MODID + ":zangetsu") in the constructor where MODID is your mod's id.