Help with "life stealing" weapon

Started by zerosevenine on

Topic category: Help with Minecraft modding (Java Edition)

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?
 

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"

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)?

 

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

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.

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

 

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 :

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

 

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.