Armor Potion Effects?

Started by SkeletonKing on Tue, 03/15/2016 - 22:00
Last seen on 22:14, 21. Nov 2017
Joined Dec 2014
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Armor Potion Effects?
Tue, 03/15/2016 - 22:00

I already know how to add potion effects to armor, but how do I add a potion effect where if the full set of armor is worn, then the effect is applied? And when you take the armor off, it goes away?

Last seen on 08:32, 22. Dec 2017
Joined Sep 2014
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
I'd like to know this too.
Tue, 03/15/2016 - 23:41

I'd like to know this too. Anyone?

Last seen on 03:24, 15. Dec 2017
Joined Dec 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
set variables so to change
Wed, 03/16/2016 - 22:44

set variables so to change when all of the armor is active. Then set it so the armor gives you effects if (desirded variable equals the desirded number)

Last seen on 08:32, 22. Dec 2017
Joined Sep 2014
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
@steve you misunderstand. He
Thu, 03/17/2016 - 00:31

@steve you misunderstand. He wants it to add the effect only if the player is wearing the ENTIRE set of armor at the same time. @ahig that wouldn't work as intended. You'd need a way to turn the variables off when the player takes the armor off.

 

 

Last seen on 03:24, 15. Dec 2017
Joined Dec 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
good point i will look into
Thu, 03/17/2016 - 12:28

good point i will look into that

Last seen on 16:33, 17. Apr 2016
Joined Mar 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
RE:good point i will look into
Fri, 04/01/2016 - 01:47

Have you found any opcion to do that? I want to do a miner armor, and with the complete set, have the night vision effect.

I saw on the MCreator wiki that with an "Armor Trigger Event" you can control if any player has the armor equipped or not... But I dont know if this will work and dont know how I can try it.

If you found any solution, can you please tell me how to do it?

Thanks and regards (sorry for the english, im spanish :p)

Last seen on 13:30, 12. Nov 2016
Joined Oct 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
If you want to see practicle
Fri, 04/01/2016 - 15:10

If you want to see practicle use for that skill check out my newest mod

Last seen on 03:24, 15. Dec 2017
Joined Dec 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Alright just set the armor so
Fri, 05/13/2016 - 01:29

Alright just set the armor so on update tick add (potion effect) change in all cases to be (if item is in slot) the set the item to be another piece of armor and set the slot id to be the slot id for the piece of armor. To make in need a full set just use stacked events so you need all of the pieces of armor in all of the armor plots before it gives you the effect.

Last seen on 12:05, 13. May 2016
Joined Apr 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Test this:
Fri, 05/13/2016 - 08:59

Test this:

 

static{
ItemArmor.ArmorMaterial enuma = EnumHelper.addArmorMaterial("ARMOR", 25, new int[] {2, 7, 5, 3}, 9);

int armorPreffix = 0;
if(FMLCommonHandler.instance().getEffectiveSide()==Side.CLIENT) armorPreffix = RenderingRegistry.addNewArmourRendererPrefix("models");
helmet = (new ItemArmor(enuma, armorPreffix, 0)
{
    @Override
    public void onArmorTick(World world, EntityPlayer player, ItemStack stack){
        if(player.getCurrentArmor(0) != null && player.getCurrentArmor(1) != null && player.getCurrentArmor(2) != null && player.getCurrentArmor(3) != null){
            ItemStack boots = player.getCurrentArmor(0);
            ItemStack legs = player.getCurrentArmor(1);
            ItemStack chest = player.getCurrentArmor(2);
            ItemStack helmet = player.getCurrentArmor(3);
            
            if(boots.getItem() == mcreator_armor.boots && legs.getItem() == mcreator_armor.legs && chest.getItem() == mcreator_armor.body && helmet.getItem() == mcreator_armor.helmet){
                player.addPotionEffect(new PotionEffect(Potion.resistance.getId(), 20, 1));
                player.addPotionEffect(new PotionEffect(Potion.regeneration.getId(), 20, 1));
                player.addPotionEffect(new PotionEffect(Potion.moveSlowdown.getId(), 20, 1));
            }
            
        }
    
}

Last seen on 18:32, 28. May 2018
Joined Jul 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Too much code for me....
Sat, 05/14/2016 - 08:15

Too much code for me....

Last seen on 11:23, 7. May 2017
Joined May 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
up how use this code ?  
Thu, 05/19/2016 - 15:33

up how use this code ?