Posted December 2, 201410 yr I would like to change the texture of a item when the player right clicks. I can detect when a player clicks, but I can not change the texture.
December 2, 201410 yr just use an array x being the number of different textures you want IIcon[] Textures = new IIcon[x]; @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister par1IconRegister) { // example of different textures assigned to a number this.Textures[0] = par1IconRegister.registerIcon(Reference.Mod_Id + ":" + "texture one"); this.Textures[1] = par1IconRegister.registerIcon(Reference.Mod_Id + ":" + "texture two"); this.Textures[2] = par1IconRegister.registerIcon(Reference.Mod_Id + ":" + "texture three"); this.Textures[3] = par1IconRegister.registerIcon(Reference.Mod_Id + ":" + "texture four"); } once you have this just change the texture based on its damage value maybe?
December 2, 201410 yr Author just use an array x being the number of different textures you want IIcon[] Textures = new IIcon[x]; @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister par1IconRegister) { // example of different textures assigned to a number this.Textures[0] = par1IconRegister.registerIcon(Reference.Mod_Id + ":" + "texture one"); this.Textures[1] = par1IconRegister.registerIcon(Reference.Mod_Id + ":" + "texture two"); this.Textures[2] = par1IconRegister.registerIcon(Reference.Mod_Id + ":" + "texture three"); this.Textures[3] = par1IconRegister.registerIcon(Reference.Mod_Id + ":" + "texture four"); } once you have this just change the texture based on its damage value maybe? thanks but I knew all that I just do not know how to change the texture.
December 2, 201410 yr Hi Just change the IIcon returned by Item.getIcon, Item.getIconFromDamageForRenderPass(), or Item.getIconFromDamage() Or if you want more control, you could use an IItemRenderer. See http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html under the Item Rendering topics. -TGG
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.