tModLoader Adding Items to Vanilla Treasure Bags

SkyanUltra

Terrarian
I haven't been able to find any guides that still exist for how to add modded items into treasure bags. Can anyone help me out here?
 
Looks like the hooks for it are for GlobalItem and you can add your stuff with OpenVanillaBag and PreOpenVanillaBag

The former looks like you can roll your own items and just give them to the player, default items will not be changed. The latter can implement the same logic but if you return false it will block the normal items from dropping.

player.QuickSpawnItem() can be used to drop the item itself.

 
Back
Top Bottom