Armor Potion Effects?

Started by SkeletonKing on

Topic category: Advanced modding

Last seen on 16:05, 15. Nov 2020
Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Armor Potion Effects?

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 04:28, 28. Oct 2018
Joined Sep 2014
Points:

User statistics:

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

I'd like to know this too. Anyone?

Last seen on 00:44, 29. Nov 2022
Joined Dec 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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 04:28, 28. Oct 2018
Joined Sep 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@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 00:44, 29. Nov 2022
Joined Dec 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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 00:44, 29. Nov 2022
Joined Dec 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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
Points:

User statistics:

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

up how use this code ?

 

Last seen on 21:42, 5. Nov 2016
Joined Mar 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I also need help with this.
Sun, 08/21/2016 - 23:59

I also need help with this. Someone please help me!!

Last seen on 12:58, 23. Sep 2019
Joined Aug 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'm gonna answer your
Mon, 08/22/2016 - 13:20

I'm gonna answer your question since I made in an old mcreator version, an armor that gives speed 3 when full set is up.

1st thing to do is to create a variable: Go to variable list and create a new one called whatever you want (I called a) and give it a value, for example 3

2nd step: create your armor mod. You have now the Armor tick events right there. Start with helmet, select the condition
NUMBER = NUMBER, it will open a little window: select your first variable a, press ok. It will open another little window for the second variable. Now write in the space at right, (where you selected a before) 0 and press ok. Now  select at left Variable set. You will see the variable to set, select a and below, in value of variable, write 1.

3rd: go to body event and do the same thing, but this time in NUMBER = NUMBER put first a and second 1, and in variable set, always a and value = 2. And go on like this in leggins and boots event (leggins--> NUMBER: a=2, variable set: a=3. Boots--> NUMBER a=3, var set: a=4).

4th: now you have to close the cycle, so go gain in body or leggins (NOT helmet or boots) event and do the same thing as before but this time, instead of having in NUMBER: a=4 and in var set: a=5, you have to set the var to a=0

5th: Now you completed the circle and the variable will pass from 0 to 4 continously only when you have the full armor weared. So you have to add the potion effect. Go in the helmet (or wherever you want) event and select same condition: first a, and for second put a number from 0 to 4 but NOT 3. Now add the potion effect: in this case speed (ID=1), duration = 20 (the duration is in ticks and a tick is = 1/20 second, so if you put a too lower value, the variable won't have time to make the cycle in time to re-give you the potion effect and it will be intermittently) and level 3 (or amplifier 2).

And it's all done, it should work fine, or at least, for me it works perfectly.

If not I'll pass you the code x)

Last seen on 21:42, 5. Nov 2016
Joined Mar 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
RE:I'm gonna answer your
Mon, 08/22/2016 - 16:09

@#13 @#13 Thnx for the help!

Last seen on 20:56, 26. Oct 2016
Joined Sep 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
RE:I'm gonna answer your
Sat, 10/01/2016 - 01:49

I'm making a Flash Mod, and I want when you put all entire armor give Speed effect and I read your comment(Kane), so I did what you said, but din't work. Do you can explain to me how I do it?