Started by
Gengar_Marc127
on
Topic category: Help with Minecraft modding (Java Edition)
Making a procedure that, when the player hits a mob with my sword it heals him a quarter of the damage dealt, i searched on forums but people only told me to add instant health, regeneration, or to change health by +2, any help please?
You'll want to make a procedure that triggers 'when entity attacked.' Then, check if the source entity, (the one attacking), has your custom item in their main hand.
This procedure trigger provides 'amount' as a special dependency, which is the amount of damage dealt. You can then set the source entity's health to their current health, + (amount * 0.25), healing them for a quarter of the damage dealt.
If you mean that the entity should receive +2 health regeneration when attacking with a sword, then try to do this (click on the link):
https://imgur.com/a/hji8i22
I haven't checked, but in theory it should work.
(I'm sorry, I made a mistake)
Try to do this (click on the link):
https://imgur.com/a/1aydAdD