Lifestealing weapom

Started by Gengar_Marc127 on

Topic category: Help with modding (Java Edition)

Last seen on 15:09, 13. Jun 2024
Joined Sep 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Lifestealing weapom

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?

Last seen on 18:01, 13. Jun 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You'll want to make a…
Fri, 10/13/2023 - 15:45

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. 

Last seen on 02:05, 19. Jun 2024
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If you mean that the entity…
Sun, 10/15/2023 - 07:10

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.

Last seen on 02:05, 19. Jun 2024
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
(I'm sorry, I made a mistake…
Sun, 10/15/2023 - 07:56

(I'm sorry, I made a mistake)

Try to do this (click on the link):
https://imgur.com/a/1aydAdD