Oxygen

OnPlayerOpenInventory

This hook is triggered when the player opens any inventory.

Definition

public override void OnPlayerOpenInventory(PlayerBase player, string itemName, int ownerDBId, int EntityId) {}

Parameters

ParameterTypeDescription
playerPlayerBaseThe instance of the player opening the inventory.
itemNamestringThe name or type of the item/container being opened.
ownerDBIdintThe database identifier of the owner of the inventory.
EntityIdintItem entity id (not all items have it).

Usage Example

public override void OnPlayerOpenInventory(PlayerBase player, string itemName, int ownerDBId, int EntityId)
{
    Console.WriteLine($"Player {player.Name} opened {itemName} (Owner ID: {ownerDBId})");
}

On this page