Anvil
Loading...
Searching...
No Matches
Anvil.API.Events.ModuleEvents.OnAcquireItem Class Referencesealed

Triggered whenever an NwItem is added to NwGameObject inventory. More...

+ Inheritance diagram for Anvil.API.Events.ModuleEvents.OnAcquireItem:
+ Collaboration diagram for Anvil.API.Events.ModuleEvents.OnAcquireItem:

Properties

NwGameObjectAcquiredBy = NWScript.GetModuleItemAcquiredBy().ToNwObject<NwGameObject>() [get]
 Gets the NwGameObject that acquired the NwItem.
 
NwGameObjectAcquiredFrom = NWScript.GetModuleItemAcquiredFrom().ToNwObject<NwGameObject>() [get]
 Gets the NwGameObject that the NwItem was taken from.
 
int AmountAcquired = NWScript.GetModuleItemAcquiredStackSize() [get]
 Gets the number of items in the item stack that were just acquired.
 
NwItemItem = NWScript.GetModuleItemAcquired().ToNwObject<NwItem>() [get]
 Gets the NwItem that triggered the event.
 
- Properties inherited from Anvil.API.Events.IEvent

Detailed Description

Triggered whenever an NwItem is added to NwGameObject inventory.

This event fires for all items when a player connects to the server, in addition to item/inventory interactions while playing.
It will also fire for characters failing ELC. In this case, it is recommended to do an early return in your event handler by checking if Item is null.

Property Documentation

◆ Item

NwItem? Anvil.API.Events.ModuleEvents.OnAcquireItem.Item = NWScript.GetModuleItemAcquired().ToNwObject<NwItem>()
get

Gets the NwItem that triggered the event.

This property will return null when a character fails ELC. It is recommended to do an early exit if this is null.


The documentation for this class was generated from the following file: