Jump to content

(1.7.10) Armor Health Modifier


SlaughterFactory

Recommended Posts

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";

}

 

}

Link to comment
Share on other sites

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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