Skip to content

OnItemCraft

Usage

  • Return a non-null value to override default behavior

Example Autogenerated

csharp
private void OnItemCraft( ItemCraftTask itemCraftTask, BasePlayer owner, Item fromTempBlueprint )
{
    Puts( "OnItemCraft works!" );
}

Location

  • ItemCrafter::CraftItem(ItemBlueprint bp, BasePlayer owner, ProtoBuf.Item/InstanceData instanceData, int amount, int skinID, Item fromTempBlueprint, bool free)
csharp
//---
	{
		fromTempBlueprint.RemoveFromContainer();
		itemCraftTask.takenItems.Add(fromTempBlueprint);
		itemCraftTask.conditionScale = 0.5f;
	}
	object returnvar = Interface.CallHook("OnItemCraft", itemCraftTask, owner, fromTempBlueprint);
	if (returnvar is bool)
	{
		return (bool)returnvar;
	}
	this.queue.AddLast(itemCraftTask);
//---

Released under the MIT License.