Skip to content

OnCuttingTake ​

Usage ​

  • Return a non-null value to override default behavior

Example Autogenerated ​

csharp
private object OnCuttingTake( GrowableEntity instance, BasePlayer player, Item item )
{
    Puts( "OnCuttingTake works!" );
    return null;
}
csharp
private void OnCuttingTake(  )
{
    Puts( "OnCuttingTake works!" );
}

Location ​

  • GrowableEntity::TakeClones(BasePlayer player)
  • GrowableEntity::TakeClones(BasePlayer player)
csharp
//---
		return;
	}
	Item item = ItemManager.Create(Properties.CloneItem, num, 0uL, isServerSide: true, 0uL);
	item.SetItemOwnership(player, ItemOwnershipPhrases.Cloned);
	GrowableGeneEncoding.EncodeGenesToItem(this, item);
	if (Interface.CallHook("OnCuttingTake", this, player, item) != null)
	{
		item.Remove();
		return;
	}
	Facepunch.Rust.Analytics.Azure.OnGatherItem(item.info.shortname, item.amount, this, player);
//---
csharp
//---
		return;
	}
	Item item = ItemManager.Create(Properties.CloneItem, num, 0uL, isServerSide: true, 0uL);
	item.SetItemOwnership(player, ItemOwnershipPhrases.Cloned);
	GrowableGeneEncoding.EncodeGenesToItem(this, item);
	if (Interface.CallHook("OnCuttingTake", this, player, item) != null)
	{
		item.Remove();
		return;
	}
	Facepunch.Rust.Analytics.Azure.OnGatherItem(item.info.shortname, item.amount, this, player);
//---

Released under the MIT License.