how would i do accumulative damage for a potion effect?

Started by Evansomething on

Topic category: Help with modding (Java Edition)

Last seen on 16:12, 2. Sep 2024
Joined Jun 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how would i do accumulative damage for a potion effect?

i wanna do a potion affect like the one in the mod Pick Your Poison and it uses accumulative damage affect a state of invincibility and takes all the damage that you gained in that state and adds it after the effect expires

Last seen on 11:33, 7. Sep 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You need two procedures…
Wed, 07/24/2024 - 21:09

You need two procedures

https://imgur.com/hqNj42p 

https://imgur.com/PEWNO8A (set this one to the trigger "when effect expires" in the effect settings)

damage is a number global variable of type "player_persistent"

Last seen on 16:12, 2. Sep 2024
Joined Jun 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
so for the set number block…
Wed, 07/24/2024 - 21:51

so for the set number block where is the "for entity" at?

Last seen on 11:33, 7. Sep 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
the "for entity:" part only…
Wed, 07/24/2024 - 21:59

the "for entity:" part only appears for player_persistent or player_lifetime variables, if you don't see it that means that you're using a variable of a different type

Last seen on 16:12, 2. Sep 2024
Joined Jun 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
thank you but would you also…
Wed, 07/24/2024 - 22:59

thank you but would you also know how to change the heart texture during the effect or nah?

Last seen on 11:33, 7. Sep 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I don't know if it's even…
Thu, 07/25/2024 - 00:38

I don't know if it's even possible, MAYBE since this plugin: https://mcreator.net/plugin/107323/new-procedures-plus adds some procedures that can change vanilla textures you could change the texture of the hearts too, but I'm really just guessing