Started by
phoenix_wb
on
Topic category: Help with Minecraft modding (Java Edition)
I want to make a piece of armour immune to a custom potion effect that I will add in the game, but I don't know how. It would be appreciated for assistance.
I don't think it is possible
I'm not sure if this is possible in MCreator, but couldn't you just cancel the event. E.x - If you want to cancel fall damage, call the fall damage event and then check if you have the armor, if so, cancel the event. Long winded description, but this is absolutely possible. As I said I haven't check if you can cancel events in MCreator but look around.
Now that I think about it, there was a cancel block under advanced. Not sure if the event you want to cancel is under global triggers though.
For anyone coming across this thread, there is a way to do this.
Firstly, make your potion effect. Then, in the procedure that tells the potion effect what to do, make it first wait ten ticks, then check if the player still has the potion effect, and only if they do, do what the effect would do.
Then, make the armor and add a body tick procedure that checks if the player has the entire armor set on (or just skip this if you don't need the player to wear the whole armor) and then tell the armor to remove the specific potion effect from the player. Since this happens every tick, and we told the potion effect to wait 10 ticks to check if the player still has the potion effect, the potion effect only kicks in if the player has had the effect for more than 10 ticks, and since the armor removes the effect every tick, this will never happen with the armor on.
There is also a condition section for the custom potion effect that controls on what conditions is your effect applicable or not. If you as a condition select having the full armor set for the entity you want to have the potion (in this case, the player), the potion shouldn't be applied if that entire armor set is equipped