tModLoader How do you put custom mod items into vanilla boss bags?

AxerTheAxe

Skeletron Prime
Hello! I have looked everywhere for this. I want to have a modded item drop from the expert Eater Of Worlds Loot / Boos bag. I have looked at Here and many other places but haven't found an awnser.
Thank you!
 
Try this:
C#:
public class TreasureBags : GlobalItem
    {


        public override void OpenVanillaBag(string context, Player player, int arg)
        {
            if (context == "bossBag" && arg == ItemID.EaterOfWorldsBossBag)
            {
                player.QuickSpawnItem(ItemType<PUTITEMNAMEHERE>(), Main.rand.Next(1, 1));
            }
        }
    }
The Main.rand.Next is just the amount, you don't need it for just 1 drop
Replace "PUTITEMNAMEHERE" with your item, without any "", but keep the <>
 
Last edited:
Back
Top Bottom