AnimalCanAttack Method |
Used to determine if your creature can attack another creature. This will return true all the time for a Carnivore since they can always attack.
For Herbivores this will return true if they are hungry enough to be aggressive. Herbivores may also attack a creature in the upcoming round if that creature attacked them in the previous round. The best place to attack a creature that is attacking you is to handle the Attacked event.
Namespace: Terrarium.Sdk.Classes.Creature
Exception | Condition |
---|---|
ArgumentNullException | Thrown if the targetAnimal parameter is null. |