"Heartstopped" potion effect

Started by J0rs on

Topic category: Help with modding (Java Edition)

Last seen on 12:32, 29. Jun 2024
Joined Jun 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
"Heartstopped" potion effect

So basically i'm quite new to this place and i want to make a mod for my friends for the server that we play on and one of my friends suggested me to make a "heartstop" potion, a potion that would negate all damage for the duration of the potion and apply it at the end. I know that the trigger "when effect expires" exists, but i just can't get my head around how it should work. Is this possible? (im on mcreator 2023.4 fabric btw)

Last seen on 22:24, 29. Jun 2024
Joined Nov 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
add a player_lifetime global…
Thu, 06/27/2024 - 19:07

add a player_lifetime global variable, have this number increase every time you take damage, by the amount of damage. when the effect ends, deal that much damage to the player and set the variable to 0.

under "advanced" procedure blocks, there is a block that can obtain a custom dependency, with triggers that require you to take damage, there is one for "amount", which is how much damage you take.

Last seen on 12:32, 29. Jun 2024
Joined Jun 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you, but when i try to…
Sat, 06/29/2024 - 08:38

Thank you, but when i try to create a new variable only global_map, global_session and global_world show up. The player persistent variables are nowhere to be seen