Started by
Ampersand
on
Topic category: Help with Minecraft modding (Java Edition)
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!
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 the effect to the player each armor tick for one tick.
Helmet's ID is 3 while boots' ID is 0*
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?
Also, are both of the local variables the same?
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!
Yes, effect levels start with 0 but are displayed as starting with 1 in the game.
Glad I could help :)