Help with "life stealing" weapon

Started by zerosevenine on

Topic category: Help with modding (Java Edition)

Last seen on 17:56, 9. Nov 2022
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Help with "life stealing" weapon

So, i've been working on an item which, in nutshell, changes your HP to your current hp + 1  or 2 (based on your current health) upon hitting something.
but it just doesn't work...?
I'll write here how the procedure looks.

if         Current health of  Event/target entity  >  10
do       Set health of  Event/target entity  to  Current health of  Event/target entity  +  1

else     Set health of  Event/target entity  to  Current health of  Event/target entity  +  2

It is supposed to give me HP upon hitting something, but it instead heals the one im hitting... i tried exchanging Event/target with Source entity, but then it didn't heal anyone, not even me, not even the one i'm hitting.
Can someone help?
 

Last seen on 17:56, 9. Nov 2022
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
To be exact, this procedure…
Fri, 12/17/2021 - 19:15

To be exact, this procedure is to be set for the trigger "When living entity is hit with tool"

Last seen on 17:56, 9. Nov 2022
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If it just doesn't work this…
Fri, 12/17/2021 - 19:18

If it just doesn't work this way, could someone at least share if there is a way to add a specific amount of HP to someone when hitting an entity (without using potion effects)?

 

Last seen on 17:56, 9. Nov 2022
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
someone please :c
Sat, 12/18/2021 - 17:37

someone please :c

Last seen on 17:56, 9. Nov 2022
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
As i have mentioned, i tried…
Tue, 12/21/2021 - 13:33

As i have mentioned, i tried both ways, once using source and once target.
With target, again as i mentioned, it healed the one i was hitting, but with source.. it didnt heal anyone, not even the one i was hitting, not me either.

Last seen on 15:24, 24. Apr 2024
Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
attach your procedure and I…
Tue, 12/21/2021 - 13:39

attach your procedure and I will help you fix it

 

Last seen on 17:56, 9. Nov 2022
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
(No subject)
Tue, 12/21/2021 - 14:51

The procedure is as following. Exchanging source entity with target entity resulted in the one im hitting being healed instead of me.

Last seen on 14:45, 14. Feb 2022
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
(No subject)
Tue, 12/21/2021 - 16:27

Here is the block you should use

Last seen on 14:45, 14. Feb 2022
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If oyu want it to be random…
Tue, 12/21/2021 - 16:31

If oyu want it to be random you can do that :

Last seen on 17:56, 9. Nov 2022
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
i know what the number does,…
Wed, 12/22/2021 - 19:31

i know what the number does, that's why i set it like that

 

Last seen on 17:56, 9. Nov 2022
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
the problem isn't i don't…
Wed, 12/22/2021 - 19:32

the problem isn't i don't know what to do, it isn't that i want it random or anything, the problem here is that when i put Source Entity there, it heals noone, not me, not the one im hitting.