Check if Player supposed to die

Started by SparkleArts on

Topic category: Help with Minecraft modding (Java Edition)

Joined Feb 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Check if Player supposed to die
Sun, 01/24/2021 - 02:43 (edited)

I want to make an Enchantment like an Totem of Undying that triggers if the Players supposed to die.

Can someone help me with this?

Edited by SparkleArts on Sun, 01/24/2021 - 02:43
Joined May 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The "Entity Dies" procedure…
Sun, 01/24/2021 - 06:01

The "Entity Dies" procedure trigger is cancelable, meaning you can just test if the entity is a player and if they have your enchantment. If those things are true, then cancel the trigger.

Joined Feb 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Nevermind I found the cancel…
Sun, 01/24/2021 - 13:34

Nevermind I found the cancel Global Trigger block, thanks for the help.

Joined Feb 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It worked but I die, I want…
Sun, 01/24/2021 - 13:52

It worked but I die, I want to be work like an totem of undying that prevent from death once.

Joined May 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
hmm... Perhaps you could…
Sun, 01/24/2021 - 15:19

hmm... Perhaps you could just prevent the damage itself with the "Before entity is hurt" trigger. To properly do this, you have to make a custom number dependency named "amount" (this can be found in the advanced tab, called Number dependency)

Then just test if "amount" is more than the player's current health. If so, then cancel the global trigger.

Joined Feb 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks now my enchantment…
Sun, 01/24/2021 - 18:54

Thanks now my enchantment works perfectly.

Joined Dec 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Could you publish the…
Wed, 09/22/2021 - 10:14

Could you publish the procedure? because I didn't understand how to do it

 

Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how do i test if the entity…
Tue, 01/04/2022 - 13:18

how do i test if the entity is a player

Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I also would like to see…
Mon, 04/03/2023 - 14:42

I also would like to see this procedure pls

Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ok nevermind. Im just dumb…
Mon, 04/03/2023 - 15:10

Ok nevermind. Im just dumb and I was doing a stupid thing. You can understand what Im doing there. Just do your own conditions to activate this "second life" and here ya go.

The main point is to choose the global trigger "Entity dies" and then cancel the trigger.
 

https://prnt.sc/St0DkPNLuwxm

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
LeZ, does cancel event…
Thu, 04/13/2023 - 15:31

LeZ, does cancel event trigger work for you with your screenshot's procedure?

Joined Feb 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@_andreax2 Cancel Event…
Fri, 04/14/2023 - 13:41

@_andreax2

Cancel Event Trigger only works with Global Triggers that can be canceled. And these works.

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@GamesofFreak i tried much…
Fri, 04/14/2023 - 13:50

@GamesofFreak i tried much times, and it doesnt work for me. I solved using "before entity hurt"

Joined Mar 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
For me I also set the entity…
Sat, 04/15/2023 - 02:07

For me I also set the entity's life to the maximum to prevent death. I'm working on a death token I may have send the player to a Styx style dimension, or I may just have it restore the health and break.