Skip to content

OnItemRefill

Usage

  • Return a non-null value to override default behavior

Example Autogenerated

csharp
private object OnItemRefill( Item item, BasePlayer player )
{
    Puts( "OnItemRefill works!" );
    return null;
}

Location

  • ItemModRepair::ServerCommand(Item item, string command, BasePlayer player)
csharp
public override void ServerCommand(Item item, string command, BasePlayer player)
{
	if (command == "refill" && !player.IsSwimming() && HasCraftLevel(player) && !(item.conditionNormalized >= 1f) && Interface.CallHook("OnItemRefill", item, player) == null)
	{
		float conditionNormalized = item.conditionNormalized;
		float maxConditionNormalized = item.maxConditionNormalized;
		item.DoRepair(conditionLost);
		if (successEffect.isValid)
//---

Released under the MIT License.