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

Hookpoints: ChestOpenReceived

D1G1T4L3CH0 edited this page Feb 13, 2015 · 2 revisions

Summary

When a chest is opened, this event is triggered.

Object Returned

Data Type Object Description
int X X coordinate of the chest.
int Y Y coordinate of the chest.
short ChestIndex The chest index.

Example

Lua

import ('Terraria') -- for Main class.

function YourPlugin:Initialized()
	export.Hooks = {}
	export.Hooks.ChestOpenReceived=
	{
		Call = export.OnChestOpenReceived,
	}
end

function YourPlugin:OnChestOpenReceived(ctx, args)
	Tools.WriteLine(Main.chest[args.ChestIndex].name)
end
Clone this wiki locally