Posted May 10, 201411 yr Hi, I need help: I made a mod which adds Nether star armor, everything is working fine. I added the enchantment effect (only the effect, not any enchantment!!!) to the items, worked. But now, I want to ask you how can I add this effect to the armor 'model' when I wear the armor (means: how do I add this effect that I can see that and other players too). Would be great if anyone could help me. The thing is, it would be great if other modders could know that too. I googled and googled, watched videos and other stuff... but I didn't find it out for so much time. Greets, FlatCrafter http://mods.cynfos.de/tools+/banner.png[/img]
May 11, 201411 yr ive added the enchantment effect to items using, @SideOnly(Side.CLIENT) public boolean hasEffect(ItemStack par1ItemStack) { return true; } with a few items like ingots and such just inside the item class, armour is made like an item and has the ability to use the effect in standard vanilla, i dont see why you cant use the method in the armour class? have you tried it
May 11, 201411 yr Author ive added the enchantment effect to items using, @SideOnly(Side.CLIENT) public boolean hasEffect(ItemStack par1ItemStack) { return true; } with a few items like ingots and such just inside the item class, armour is made like an item and has the ability to use the effect in standard vanilla, i dont see why you cant use the method in the armour class? have you tried it Yes I did this exactly like you, but I don't see this 'glitter/enchantment' effect at the model. BTW, this is my NetherStarArmor class: [spoiler=NetherStarArmor.java] package de.cynfos.toolsplus.armor; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import de.cynfos.toolsplus.Armor; import de.cynfos.toolsplus.ToolsPlus; import net.minecraft.entity.Entity; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemArmor.ArmorMaterial; import net.minecraft.item.ItemStack; public class NetherStarArmor extends ItemArmor { public NetherStarArmor(ArmorMaterial material, int ID, int placement) { super(material, ID, placement); setCreativeTab(ToolsPlus.tabToolsPlus); if (placement == 0) { setTextureName(ToolsPlus.MODID + ":nether_star_helmet"); } else if (placement == 1) { setTextureName(ToolsPlus.MODID + ":nether_star_chestplate"); } else if (placement == 2) { setTextureName(ToolsPlus.MODID + ":nether_star_leggings"); } else if (placement == 3) { setTextureName(ToolsPlus.MODID + ":nether_star_boots"); } } public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { if (stack.getItem() == Armor.NetherStarHelmet || stack.getItem() == Armor.NetherStarChestplate || stack.getItem() == Armor.NetherStarBoots) { return ToolsPlus.MODID + ":textures/models/armor/nether_star_layer_1.png"; } if (stack.getItem() == Armor.NetherStarLeggings) { return ToolsPlus.MODID + ":textures/models/armor/nether_star_layer_2.png"; } else { return null; } } @SideOnly(Side.CLIENT) public boolean hasEffect(ItemStack par1ItemStack) { return true; } } http://mods.cynfos.de/tools+/banner.png[/img]
May 13, 201411 yr with the haseffect method use this because that version of hasEffect is depreciated @SideOnly(Side.CLIENT) public boolean hasEffect(ItemStack par1ItemStack, int pass) { return true; }
May 13, 201411 yr Author If I use your method, it's going to be the same effect. No changes http://mods.cynfos.de/tools+/banner.png[/img]
May 13, 201411 yr Author Ok guys, I solved the problem. Many thanks to all of you! Here is my new hasEffect() method: @SideOnly(Side.CLIENT) public boolean hasEffect(ItemStack par1ItemStack) { par1ItemStack.setTagInfo("ench", new NBTTagList()); return true; } I have to relink to this thread on the Minecraft Forums: LINK http://mods.cynfos.de/tools+/banner.png[/img]
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.