Skip to content

OnCowMilk ​

Usage ​

  • No return behavior

Example Autogenerated ​

csharp
private void OnCowMilk(  )
{
    Puts( "OnCowMilk works!" );
}
csharp
private bool? OnCowMilk( Rust.Ai.Gen2.Cow instance, BasePlayer player, Item item )
{
    Puts( "OnCowMilk works!" );
    return null;
}
csharp
private void OnCowMilk(  )
{
    Puts( "OnCowMilk works!" );
}

Location ​

  • Rust.Ai.Gen2.Cow::TryMilk(BasePlayer player)
  • Rust.Ai.Gen2.Cow::TryMilk(BasePlayer player)
  • Rust.Ai.Gen2.Cow::TryMilk(BasePlayer player)
csharp
//---
	}
	if (MilkDef != null)
	{
		int num = MilkedAmount();
		Item item = ItemManager.Create(MilkDef, num, 0uL, isServerSide: true, 0uL);
		object obj = Interface.CallHook("OnCowMilk", this, player, item);
		if (obj != null)
		{
			item.Remove();
			if (!(obj is bool))
			{
//---
csharp
//---
	}
	if (MilkDef != null)
	{
		int num = MilkedAmount();
		Item item = ItemManager.Create(MilkDef, num, 0uL, isServerSide: true, 0uL);
		object obj = Interface.CallHook("OnCowMilk", this, player, item);
		if (obj != null)
		{
			item.Remove();
			if (!(obj is bool))
			{
//---
csharp
//---
	}
	if (MilkDef != null)
	{
		int num = MilkedAmount();
		Item item = ItemManager.Create(MilkDef, num, 0uL, isServerSide: true, 0uL);
		object obj = Interface.CallHook("OnCowMilk", this, player, item);
		if (obj != null)
		{
			item.Remove();
			if (!(obj is bool))
			{
//---

Released under the MIT License.