Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (โ‹ฎ) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hello I am trying to give my armor infinite durability [similar to the Angelic Armor in Divine RPG]

Can anyone help?

  • Author

Hello I am trying to give my armor infinite durability [similar to the Angelic Armor in Divine RPG]

Can anyone help?

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

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

  • 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?

  • 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?

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

  • 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?

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions โ†’ Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.