Check if player take damage

Started by EL0FBRENO-_- on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Check if player take damage

I created an item called "Totem of Dying", and I want that when I take damage, I die instantly, but, I don't know how to check if the player took damage.

Joined Jun 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Global Trigger - Entity hurt…
Sun, 07/18/2021 - 13:36

Global Trigger - Entity hurt

If Entity is subtype EntityPlayer OR EntityPlayerMP

  • If [checking inventory for item]
  •  - Kill Them

 

OR you could do

 

On Item in Inventory Tick

If item is your item

  • tempHP = current health
  • If current health > tempHP
  •  - Kill them
Joined Jun 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
That bottom one will work…
Sun, 07/18/2021 - 13:37

That bottom one will work with any entity holding the item

 

The top is targeting specifically players (the MP one is for multiplayer support)

Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
could you take a screenshot…
Sun, 07/18/2021 - 19:49

could you take a screenshot of the procedure for me? Because I'm not understanding how to do it

Joined Jun 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Didn't make it, just thought…
Mon, 07/19/2021 - 01:09

Didn't make it, just thought of the blocks and the logic and going from there

 

The health might need DTM's Toolkit plugin

 

The "Kill Them" part can be done anyway you can cause the player to lose health