Skip to content

OnHealingItemUse

Usage

  • Return a non-null value to override default behavior

Example Autogenerated

csharp
private object OnHealingItemUse( MedicalTool instance, BasePlayer fromPlayer, IMedicalToolTarget toTarget )
{
    Puts( "OnHealingItemUse works!" );
    return null;
}

Location

  • MedicalTool::GiveEffectsTo(BasePlayer fromPlayer, IMedicalToolTarget toTarget)
csharp
//---
		ItemModConsumable component = ownerItemDefinition.GetComponent<ItemModConsumable>();
		if (component == null)
		{
			Debug.LogWarning("No consumable for medicaltool: " + base.name);
		}
		else if (Interface.CallHook("OnHealingItemUse", this, fromPlayer, toTarget) == null)
		{
			Facepunch.Rust.Analytics.Azure.OnMedUsed(ownerItemDefinition.shortname, fromPlayer, toTarget.GetEntity());
			toTarget.OnMedicalToolApplied(fromPlayer, ownerItemDefinition, component, this, canRevive);
		}
	}
//---

Released under the MIT License.