Jump to content

Full Armor Set Potion Effect


314owen

Recommended Posts

Use:

@Override
public void onArmorTickUpdate(World world, EntityPlayer player, ItemStack stack) { }

Check whether or not the slot is equipped with what item you want.

 

Psuedo Code:

@Override
public void onArmorTickUpdate(World world, EntityPlayer player, ItemStack stack) {
if (player.getCurrentArmor(0) == ZealCraft.quickBoots) {
//do action
}
}

 

0 - Boots

1 - Leggings

2 - Chestplate

3 - Helmet

(correct me, if I'm wrong)

Link to comment
Share on other sites

^^ What he said. The basic premise is correct, though; use the armor tick update method and check that the player is wearing your armor in all 4 slots using getCurrentArmor. The indices above are correct, (0 is boots, etc), so be sure to compare the correct slots as well as null check or you will crash if the player is not wearing any particular piece.

 

ItemStack boots = player.getCurrentArmor(0);
// do same for legs, chest, helm
if (boots != null && boots.getItem() == YourMod.yourSpecialBoots && // do so for the rest of them) {
// add potion effect
}

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now


×
×
  • Create New...

Important Information

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