Hookpoints: InventoryItemReceived - SignatureBeef/Terraria-s-Dedicated-Server-Mod GitHub Wiki

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