Make an Item that heals damage if Undead Mob is hit

Started by SuperfreekYT on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Make an Item that heals damage if Undead Mob is hit

Hi. I was planning to create a Totem (like a totem of undying) that heals the player if he hits an undead mob (Zombie, Skeleton, etc.). That should only happen if the Totem is in the offhand. How do I do that???

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
set global trigger "if…
Wed, 06/07/2023 - 18:18

set global trigger "if entity attacked"
if item in offhand of SOURCE ENTITY = your item
AND event/target entity = undead (i dont know how its called and where to find)
do set health of source entity (current health of source entity) + health value that you want

Joined Jan 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You could do something like…
Wed, 06/07/2023 - 18:23

You could do something like this:

Create a procedure with a global trigger that checks to see if the entity that was attacked is undead, and if the attacker is holding the item you want.

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you very much :)
Fri, 06/09/2023 - 13:13

Thank you very much :)