Greetings fellow modders,
I am working on a mod that is going to add a ton of armor into the game, currently its only for 1.7.10 but I'll update it to 1.8 once it is completely finished. So my question is I want to add health to the player when they equip a set of armor, I have the full set in one class(I can divy it up into multiple classes if I have to but I would rather not) I just don't know the code or what I need to do to add that on to my armor. Heres the code for the stone armor, and say i wanted to add an extra 2 hearts of health to the bar, how would i go about that?
package slaughterfactory.kingsadventure.item;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import slaughterfactory.kingsadventure.KingsAdventure;
public class ItemStoneArmor extends ItemArmor {
public ItemStoneArmor(ArmorMaterial armorMaterial, int renderIndex,
int armorType) {
super(armorMaterial, renderIndex, armorType);
}
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
{
if(this.armorType == 2)
{
return "ka:textures/models/armor/stone_layer_2.png";
}
return "ka:textures/models/armor/stone_layer_1.png";
}
}