Enchantment that restores one HP

Started by Mr.Straw on

Topic category: Help with Minecraft modding (Java Edition)

Joined Dec 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Enchantment that restores one HP

I would like to create a sword enchantment that restores one HP to the player with a certain chance at level 1 if the player deals damage to undead. However, I did not find any block of the procedure that would exactly restore health. I tried to do it through negative damage, but it didn't work. I also wanted to do it through the NBT tag, but my head is exploding from thinking about how to do it. Is there any way to restore a certain amount of health points? If anything, I would not want to do it through the effects of regeneration or instant health recovery.

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
(Set (event/target entity)…
Thu, 07/13/2023 - 11:53

(Set (event/target entity) HP to ((get HP of (event/target entity) + (1)))

You will need to swap out parts of the procedure block to get this result, you also might need to swap event/target entity for sourceentity depending on what trigger you use