I'm trying to detect if a victim is damaged AGAIN in this while loop after damage, but the loop is exited instantly instead of waiting for a second attack to happen like I want it to.
Code:
On damage:
if type of victim is a slime:
while block below victim is not grass block or oak leaf or moss carpet:
send "hi there" to attacker #just to ensure that I get into the loop
wait 1 tick
if victim is damaged:
send "damaged" to attacker #just to make sure that this is the reason the loop stops
exit loop
currently I receive 1 "hi there" and 1 "damaged" after punching the slime
If someone could help me make it so that the loop is only exited after 2 punches that would be great
Code:
On damage:
if type of victim is a slime:
while block below victim is not grass block or oak leaf or moss carpet:
send "hi there" to attacker #just to ensure that I get into the loop
wait 1 tick
if victim is damaged:
send "damaged" to attacker #just to make sure that this is the reason the loop stops
exit loop
currently I receive 1 "hi there" and 1 "damaged" after punching the slime
If someone could help me make it so that the loop is only exited after 2 punches that would be great