AnimalBeginEating Method |
Method used to command your creature to start eating another creature. You can only eat one target creature per round, and a single call to BeginEating will only attack a target creature in the upcoming tick. Calling BeginEating multiple times in the same turn will only result in your creature eating the target specified in the last call to BeginEating.
Eating is asynchronous so you'll need to handle the EatCompleted event in order to get the status of the bite. A single bite might not produce enough energy for your creature so you'll have to make multiple bites against the same target until it is completed eaten.
Namespace: Terrarium.Sdk.Classes.Creature
Exception | Condition |
---|---|
ArgumentNullException | Thrown if the targetOrganism parameter is null. |
AlreadyFullException | Thrown if your creature is not hungry enough to eat. |
NotVisibleException | Thrown if the creature had disappeared from your creature's view. |
NotWithinDistanceException | Thrown if your creature is not within eating distance. |
ImproperFoodException | Thrown if a Carnivore tries to eat a plant or a Herbivore tries to eat an Animal |
NotDeadException | Thrown if a Carnivore tries to eat a creature that isn't dead yet. |