Skip to content

OnCowMilked ​

Usage ​

  • No return behavior

Example Autogenerated ​

csharp
private void OnCowMilked( Rust.Ai.Gen2.Cow instance, BasePlayer player, Item item )
{
    Puts( "OnCowMilked works!" );
}

Location ​

  • Rust.Ai.Gen2.Cow::TryMilk(BasePlayer player)
csharp
//---
		player.GiveItem(item);
		if (MilkEffect != null && MilkEffect.isValid)
		{
			Effect.server.Run(MilkEffect.resourcePath, this, 0u, Vector3.zero, Vector3.zero);
		}
		Interface.CallHook("OnCowMilked", this, player, item);
		Facepunch.Rust.Analytics.Azure.OnLivestockCowMilked(player, this, num);
	}
	milkTimer.Start(MilkCooldown / GeneScale(LivestockGene.Yield));
	return true;
}

Released under the MIT License.