0

I am trying to cancel all damage from hostile mobs when a variable for a player is true. Currently, It can cancel only attacks. When I tried to put the other types of damage it gives me the error the damage does not have a past state. I've struggled to find a solution to the syntax, but it makes things even worse.

Here is my code:

on damage of a player:
    if {mine.%victim%} is true:
        damage was caused by an attack, a projectile, an explosion, a potion, thorns or poison:
            attacker is not a player:
                cancel event

1 Answer 1

1

You should use something like this :

on damage:
   if {mine.%victim%} is true:
      attacker is mob:
         cancel event
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.