Click or drag to resize
AnimalBeginAttacking Method

Method used to command your creature to start attacking another creature. You can only attack one creature per round, and a single call to BeginAttacking will only attack a target creature in the upcoming tick. Calling BeginAttacking multiple times in the same turn will only result in your creature attacking the target specified in the last call to BeginAttacking.

Attacking is asynchronous so you'll need to handle the AttackCompleted event in order to get the status of your attack. A single attack might not kill a target enemy so you should detect if the enemy is still alive and call BeginAttacking once per round until the target creature is either dead or has escaped.

Namespace: Terrarium.Sdk.Classes.Creature
Assembly: Terrarium.Sdk (in Terrarium.Sdk.dll) Version: 1.1.0.0 (1.1.0.0)
Syntax
public void BeginAttacking(
	AnimalState targetAnimal
)

Parameters

targetAnimal
Type: Terrarium.Sdk.Classes.StateAnimalState
The AnimalState object that represents the creature you want your creature to attack.
Exceptions
ExceptionCondition
ArgumentNullException Thrown if the targetAnimal parameter is null.
NotHungryException Thrown if the creature is not hungry enough to attack.
See Also