Accumulative Damage

Started by Evanhere on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Accumulative Damage

I wanna do a potion effect that makes you invinicable until the effect is over and then its deals all the damage you accumulated lakefront the mod Pick your Poison 

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Add a custom, player…
Wed, 07/24/2024 - 18:06

Add a custom, player-lifetime number variable. (I'll call it 'accumulated_damage.') Then make a global procedure with the trigger 'before entity is hurt.'

Check if the entity is a subtype of a player, and that they have the potion effect. If this is the case, cancel the event. (You can find this function in the 'advanced' tab.) Instead, add the 'amount' dependency to the 'accumulated_damage' variable. (Set the variable to itself, plus the amount of damage dealt. When the effect expires, or reaches 1 tick remaining, deal damage to the entity equal to this variable.