Posted March 30, 20214 yr I am very new to Java and I wanted to learn how to code armor to give potion effects to the player when worn. The armor itself is already implemented, the giving potion effects part is the only thing missing because I do not know how.
March 30, 20214 yr Author 3 hours ago, diesieben07 said: Subscribe to LivingEquipmentChangeEvent. Check if they are now wearing your armor (and weren't before) and add the potion effects. Check if they are now not wearing your armor (and were before) and remove the potion effects. Can you give an example? I'm not that familiar how to code this
May 12, 20214 yr I did this by overriding onArmorTick and adding the potion effect there, is that incorrect?
May 12, 20214 yr 1 hour ago, SovereignRed said: I did this by overriding onArmorTick and adding the potion effect there, is that incorrect? first this is not your thread, create next time your own itself it would work, you then only give the player the effect for the next tick, if you then use the night vision potion for example, the view is very strange because the potion kind of fades away and you do not have the achieved effect, test it out and you will see whats happen At the LivingEquipmentChangeEvent you give the player an infinite effect, and you remove it if the player takes the item from the armor slot that would be the most plausible explanation for me, correct me if something is wrong😀
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.