Skip to content
This repository was archived by the owner on Apr 17, 2021. It is now read-only.

Hookpoints: InventoryItemReceived

D1G1T4L3CH0 edited this page Mar 5, 2015 · 2 revisions

Summary

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.

Object Returned

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

Example

Lua

function YourPlugin:Initialized()
	export.Hooks = {}
	export.Hooks.InventoryItemReceived=
	{
		Call = export.OnInventoryItemReceived,
	}
end

function YourPlugin:OnInventoryItemReceived(ctx, args)
	--example to be written later
end

Clone this wiki locally