Posted April 24, 201312 yr Hello I am trying to give my armor infinite durability [similar to the Angelic Armor in Divine RPG] Can anyone help?
April 24, 201312 yr Author Hello I am trying to give my armor infinite durability [similar to the Angelic Armor in Divine RPG] Can anyone help?
April 24, 201312 yr Use ISpecialArmor and when it comes to getting damaged in the code, put nothing there This is the creator of the Rareores mod! Be sure to check it out at
April 24, 201312 yr Use ISpecialArmor and when it comes to getting damaged in the code, put nothing there This is the creator of the Rareores mod! Be sure to check it out at
April 25, 201312 yr Author Im a bit of a noob to modding. Do I edit the Ispecialarmor class? Or is it somthing i create? Or how does this work?
April 25, 201312 yr Author Im a bit of a noob to modding. Do I edit the Ispecialarmor class? Or is it somthing i create? Or how does this work?
April 25, 201312 yr Your item class just has to implement ISpecialArmor like this: .... public class YourArmor implements ISpecialArmor { ... your methods public void damageArmor(EntityLiving entity, ItemStack stack, DamageSource source, int damage, int slot){} ... anything else } and done. your armor should now not take damage anymore
April 26, 201312 yr Author package JerryMod; import java.util.List; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumArmorMaterial; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.util.DamageSource; import net.minecraft.util.StringTranslate; import net.minecraftforge.common.IArmorTextureProvider; import net.minecraftforge.common.ISpecialArmor; public class JerrysArmor extends ItemArmor implements ISpecialArmor { public JerrysArmor(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) { super(par1, par2EnumArmorMaterial, par3, par4); this.setCreativeTab(JerrysMod.CreativeTab); } public String getArmorTextureFile(ItemStack itemstack) { if(itemstack.itemID == JerrysMod.SlimeHelmet.itemID || itemstack.itemID == JerrysMod.SlimeChestplate.itemID){ return "/mods/jerrymod/textures/armor/Slime_1.png"; } if(itemstack.itemID == JerrysMod.SlimeBoots.itemID){ return "/mods/jerrymod/textures/armor/Slime_2.png"; } if(itemstack.itemID == JerrysMod.SlimeLeggings.itemID){ return "/mods/jerrymod/textures/armor/Slime_2.png"; } else return null; } public String getItemDisplayName(ItemStack par1ItemStack) { String var2 = ("\u00a7a" + StringTranslate.getInstance().translateNamedKey(this.getLocalizedName(par1ItemStack))).trim(); return var2; } @SideOnly(Side.CLIENT) public void damageArmor(EntityLiving entity, ItemStack stack, DamageSource source, int damage, int slot){} public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean i) { list.add("Infinite Durability"); } } ================================================= public class JerrysArmor extends ItemArmor implements ISpecialArmor { The JerrysArmor is giving me an error? any help?
April 26, 201312 yr package JerryMod; import java.util.List; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumArmorMaterial; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.util.DamageSource; import net.minecraft.util.StringTranslate; import net.minecraftforge.common.IArmorTextureProvider; import net.minecraftforge.common.ISpecialArmor; public class JerrysArmor extends ItemArmor implements ISpecialArmor { public JerrysArmor(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) { super(par1, par2EnumArmorMaterial, par3, par4); this.setCreativeTab(JerrysMod.CreativeTab); } public String getArmorTextureFile(ItemStack itemstack) { if(itemstack.itemID == JerrysMod.SlimeHelmet.itemID || itemstack.itemID == JerrysMod.SlimeChestplate.itemID){ return "/mods/jerrymod/textures/armor/Slime_1.png"; } if(itemstack.itemID == JerrysMod.SlimeBoots.itemID){ return "/mods/jerrymod/textures/armor/Slime_2.png"; } if(itemstack.itemID == JerrysMod.SlimeLeggings.itemID){ return "/mods/jerrymod/textures/armor/Slime_2.png"; } else return null; } public String getItemDisplayName(ItemStack par1ItemStack) { String var2 = ("\u00a7a" + StringTranslate.getInstance().translateNamedKey(this.getLocalizedName(par1ItemStack))).trim(); return var2; } @SideOnly(Side.CLIENT) public void damageArmor(EntityLiving entity, ItemStack stack, DamageSource source, int damage, int slot){} public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean i) { list.add("Infinite Durability"); } } ================================================= public class JerrysArmor extends ItemArmor implements ISpecialArmor { The JerrysArmor is giving me an error? any help? What error? I assume your class name (public class JerrysArmor) is not equal to the java filename (in this case it must be named like "JerrysArmor.java"). Also those names are case-sensitive! Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! | mah twitter This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.
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.