Table of Contents

Class ItemSlotInstance

Namespace
S1API.Items
Assembly
S1API.dll

Represents an item slot within the game. These are present within storage, the hot bar, etc.

public class ItemSlotInstance
Inheritance
ItemSlotInstance
Inherited Members
Extension Methods

Remarks

Lock state and events reflect native state delivered to the current peer. They do not grant authority or guarantee network callback ordering. Events belong to this wrapper: retain it to unsubscribe before discarding it, and subscribe again when a save reload replaces the slot.

Properties

ActiveLock

Gets a managed snapshot of the active lock reason, or null when no lock is active.

public ItemSlotLockInfo? ActiveLock { get; }

Property Value

ItemSlotLockInfo?

Remarks

The snapshot contains no native owner and does not change when the slot's lock changes.

IsAddLocked

Gets the native slot's independent flag that prevents adding items.

public bool IsAddLocked { get; }

Property Value

bool

IsLocked

Gets whether the native slot has an active lock on the current peer.

public bool IsLocked { get; }

Property Value

bool

IsRemovalLocked

Gets the native slot's independent flag that prevents removing items.

public bool IsRemovalLocked { get; }

Property Value

bool

ItemInstance

The item instance the slot contains.

public ItemInstance? ItemInstance { get; }

Property Value

ItemInstance

Quantity

The quantity of item in this slot.

public int Quantity { get; }

Property Value

int

Methods

AddQuantity(int)

Adds a quantity to the item in this slot. NOTE: Negative numbers are supported and allowed.

public void AddQuantity(int amount)

Parameters

amount int

Events

FilterChanged

Occurs when the native slot reports a player-filter change.

public event Action FilterChanged

Event Type

Action

ItemDataChanged

Occurs when the native slot reports a change to its item data.

public event Action ItemDataChanged

Event Type

Action

ItemInstanceChanged

Occurs when the native slot reports an item-instance change.

public event Action ItemInstanceChanged

Event Type

Action

Locked

Occurs when the native slot reports that a lock was applied.

public event Action Locked

Event Type

Action

Remarks

Independent changes to IsAddLocked or IsRemovalLocked do not raise this event.

Unlocked

Occurs when the native slot reports that its active lock was removed.

public event Action Unlocked

Event Type

Action