Class ItemSlotInstance
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
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
IsLocked
Gets whether the native slot has an active lock on the current peer.
public bool IsLocked { get; }
Property Value
IsRemovalLocked
Gets the native slot's independent flag that prevents removing items.
public bool IsRemovalLocked { get; }
Property Value
ItemInstance
The item instance the slot contains.
public ItemInstance? ItemInstance { get; }
Property Value
Quantity
The quantity of item in this slot.
public int Quantity { get; }
Property Value
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
amountint
Events
FilterChanged
Occurs when the native slot reports a player-filter change.
public event Action FilterChanged
Event Type
ItemDataChanged
Occurs when the native slot reports a change to its item data.
public event Action ItemDataChanged
Event Type
ItemInstanceChanged
Occurs when the native slot reports an item-instance change.
public event Action ItemInstanceChanged
Event Type
Locked
Occurs when the native slot reports that a lock was applied.
public event Action Locked
Event Type
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