Need Help Making Armor That Gives Potion Effects When Worn

Started by Ampersand on

Topic category: Help with modding (Java Edition)

Last seen on 00:57, 28. Nov 2021
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Need Help Making Armor That Gives Potion Effects When Worn

Hey! So I'm trying to make a mod with different types of armor, each set giving you different potion effects while worn. I want to have the effects get stronger as you wear more pieces of armor. I tried to do this by messing with variables and if statements but couldn't get it to work. Can someone help me with this or walk me through it?

I also need help getting the effects off the player when they're not wearing any armor. Once they put a piece on, the effect is there permanently.

Thanks for your time!

Last seen on 17:49, 25. Mar 2021
Joined Jun 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Add this procedure to on…
Tue, 07/02/2019 - 08:36

Add this procedure to on tick update of every armor piece:

If item in player's armor slot 0 = helmet

Set (local variable) to (local variable) +1

If item in player's armor slot 1 = chestplate

Set (local variable) to (local variable) +1

If...

Set...

If...

Set...

Add potion effect to player level (local variable) for 60 ticks

 

 

I don't remember well the names of the procedure blocks right now. If you want, I will later send you an image

Use armor tick event and add…
Tue, 07/02/2019 - 08:39

Use armor tick event and add the effect to the player each armor tick for one tick.

Last seen on 17:49, 25. Mar 2021
Joined Jun 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Helmet's ID is 3 while boots…
Tue, 07/02/2019 - 08:59

Helmet's ID is 3 while boots' ID is 0*

Last seen on 00:57, 28. Nov 2021
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yeah, if you could send a…
Tue, 07/02/2019 - 14:33

Yeah, if you could send a screenshot, that would be great, but when you say "if item in armor slot 0 = helmet" How do I put in the helmet? Should I just add an item box thing and add the custom helmet?

Last seen on 00:57, 28. Nov 2021
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Also, are both of the local…
Tue, 07/02/2019 - 14:44

Also, are both of the local variables the same?

Last seen on 00:57, 28. Nov 2021
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Nevermind, works great! Only…
Tue, 07/02/2019 - 15:04

Nevermind, works great! Only thing is, If I want the effect to be speed 1 for example, do I have to set the effect level to 0?

Anyways thanks for helping me out!

Last seen on 17:49, 25. Mar 2021
Joined Jun 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yes, effect levels start…
Wed, 07/03/2019 - 07:54

Yes, effect levels start with 0 but are displayed as starting with 1 in the game.

Glad I could help :)