This repository was archived by the owner on Apr 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
Hookpoints: InventoryItemReceived
D1G1T4L3CH0 edited this page Mar 5, 2015
·
2 revisions
Item placed in player's inventory, picked up from inventory, and picked up from world. This can create a lot of calls. Inventory slot 58 is the cursor, you can use that to detect if the player has picked up the item from inventory, you may want to ignore those.
| Data Type | Object | Description |
|---|---|---|
| int | InventorySlot | Inventory slot number. |
| int | Amount | How many. |
| string | Name | Item name. |
| int | Prefix | Item prefix number to the name. Use with Terraria.Item.Prefix(). |
| int | NetID | NetID |
Lua
function YourPlugin:Initialized()
export.Hooks = {}
export.Hooks.InventoryItemReceived=
{
Call = export.OnInventoryItemReceived,
}
end
function YourPlugin:OnInventoryItemReceived(ctx, args)
--example to be written later
end