Check if player would receive lethal damage

Started by PhoenixofDeath on

Topic category: Help with MCreator software

Joined Apr 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Check if player would receive lethal damage

I want to check if the player would die from an attack/damage of any kind, to revive him afterwards if certain conditions are met. (same logic as Totem of Undiying)

I want my item to have an ability that prevents the wearer from dying while holding it. After that it would be good if the item is not consumed, but gets a cooldown on this ability.

Is this possible, or too complex?

Joined Jul 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
anything is possible if you…
Thu, 05/12/2022 - 14:59

anything is possible if you try hard enough !!!! :DDD

use an event checking for if the player was damaged, then somehow check how much damage the event dealt, and if the player is holding the item and the player's current health amount minus the damage dealt is less than 1, cancel the global trigger and do whatever else the item does

alternatively maybe you could check if a player dies or is dead and then try to restore their stuff, but remember that first spawning in a world and exiting the end also count as dying

Joined Aug 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
"first spawning in a world…
Wed, 10/30/2024 - 16:26

"first spawning in a world and exiting the end also count as dying" is that real tho? Exiting the end counts as dying??