How to limit resistance effect to 4?

Started by vinicius0910 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Feb 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to limit resistance effect to 4?

i made a mod that you get stronger by killing mobs and i want to limit resistance effect to 4 because after 5 you get immortal, someone know how to do it?

Joined Feb 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
First Option you do the…
Wed, 07/19/2023 - 20:10

First Option

you do the level with a variable wich grows with every level, but before growing it tests if level is 4. If thats true it wont gro any further

else level the effect up

Second Option

Before leveling the effect up it tests if the effect is kevel 4 by using the "get level of effect" block.

if thats true it wont do anything else level up