How to make certain armour make you immune to a potion effect.

Started by phoenix_wb on

Topic category: Help with modding (Java Edition)

Last seen on 09:38, 31. Mar 2020
Joined Feb 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make certain armour make you immune to a potion effect.

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.

Last seen on 03:10, 19. Feb 2022
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I don't think it is possible
Mon, 03/23/2020 - 02:06

I don't think it is possible

Last seen on 04:35, 17. Jan 2021
Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'm not sure if this is…
Mon, 04/13/2020 - 18:10

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.

Last seen on 04:35, 17. Jan 2021
Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Now that I think about it,…
Mon, 04/13/2020 - 18:11

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.

Last seen on 15:06, 22. Feb 2023
Joined Jun 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
For anyone coming across…
Sat, 02/18/2023 - 15:35

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.

Last seen on 15:22, 28. Mar 2024
Joined Feb 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
There is also a condition…
Wed, 05/31/2023 - 22:00

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