Skip to content

OnItemUnwrap

Usage

  • Return a non-null value to override default behavior

Example Autogenerated

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

Location

  • ItemModUnwrap::ServerCommand(Item item, string command, BasePlayer player)
csharp
public override void ServerCommand(Item item, string command, BasePlayer player)
{
	if (command == "unwrap" && item.amount > 0 && Interface.CallHook("OnItemUnwrap", item, player, this) == null)
	{
		item.UseItem();
		int num = UnityEngine.Random.Range(minTries, maxTries + 1);
		ItemOwnershipShare ownership = default(ItemOwnershipShare);
		if (OwnershipPhrase != null && !string.IsNullOrEmpty(OwnershipPhrase.token))
//---

Released under the MIT License.