Skip to content

OnItemUse

Usage

  • Return TYPE to prevent default behavior

Example Autogenerated

csharp
private void OnItemUse( Item instance, int amountToConsume )
{
    Puts( "OnItemUse works!" );
}

Location

  • Item::UseItem(int amountToConsume)
csharp
//---
{
	if (amountToConsume <= 0)
	{
		return;
	}
	object returnvar = Interface.CallHook("OnItemUse", this, amountToConsume);
	if (returnvar is int)
	{
		amountToConsume = (int)returnvar;
	}
	this.amount -= amountToConsume;
//---

Released under the MIT License.