Skip to content

CanNpcEat

Usage

  • Return a non-null value to override default behavior

Example Autogenerated

csharp
private void CanNpcEat( BaseNpc instance, BaseEntity best )
{
    Puts( "CanNpcEat works!" );
}

Location

  • BaseNpc::WantsToEat(BaseEntity best)
csharp
public virtual bool WantsToEat(BaseEntity best)
{
	object returnvar = Interface.CallHook("CanNpcEat", this, best);
	if (returnvar is bool)
	{
		return (bool)returnvar;
	}
	return best.HasTrait(BaseEntity.TraitFlag.Food) && !best.HasTrait(BaseEntity.TraitFlag.Alive);
//---

Released under the MIT License.