How to detect an items damage?

Started by ThatBuba on

Topic category: Help with modding (Java Edition)

Last seen on 20:07, 27. Apr 2024
Joined Mar 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to detect an items damage?
Thu, 03/28/2024 - 20:36 (edited)

So I tried to make a sword that leeches health

and the amount of healing the player gets when he hits a mob scales with the items attack damage

but i cant find any block that detects the item's attack damage

i figured if theres a block which detects the players health then it should have a block that is labelled as "damage of (source enitity) or some other thing

pls help

 

EDIT: i tried to add in the variable "amount" but it said theres compatibility issues.. the error message keeps popping out

Edited by ThatBuba on Thu, 03/28/2024 - 20:36
Last seen on 01:09, 28. Apr 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I think you can count the…
Tue, 04/02/2024 - 01:02

I think you can count the damage by subtracting from the full hp - the current hp

Last seen on 10:23, 2. Apr 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you for the suggestion.
Tue, 04/02/2024 - 10:25

Thank you for the suggestion.