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