tModLoader How do I make modded items appear in chests?

Inkplasm

Spazmatism
Trying to make more items appear in Shadow and Dungeon chests but I have no idea how to do this. Anybody know how?
 
there are a lot of errors. what am I doing wrong?
using ExampleMod.Items;
using ExampleMod.NPCs;
using ExampleMod.Tiles;
using IL.Terraria;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System.Collections.Generic;
using System.IO;
using Terraria;
using Terraria.DataStructures;
using Terraria.GameContent.Generation;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
using Terraria.ModLoader.IO;
using Terraria.World.Generation;
using ZephyrMod.Items.Weapons.Magic;
using static Terraria.ModLoader.ModContent;

namespace ZephyrMod
{
public class ZephyrModWorld : ModWorld
{

int[] itemsToPlaceInPyramidChests = { ItemType<ThePyramid>() };
int itemsToPlaceInIPyramidChestsChoice = 0;
for (int chestIndex = 0; chestIndex< 1000; chestIndex++) {
Chest chest = Main.chest[chestIndex];
if (chest != null && Main.tile[chest.x, chest.y].type == TileID.Containers && Main.tile[chest.x, chest.y].frameX == 11 * 36) {
for (int inventoryIndex = 0; inventoryIndex< 40; inventoryIndex++) {
if (chest.item[inventoryIndex].type == ItemID.None) {
Chest.item[inventoryIndex].SetDefaults(itemsToPlaceInIceChests[itemsToPlaceInIceChestsChoice]);
itemsToPlaceInIceChestsChoice = (itemsToPlaceInIceChestsChoice + 1) % itemsToPlaceInIceChests.Length;
break;
} }
 
I have been trying to make it so my modded accessory can be found in all chests. But example mod is kinda just confusing me. I hope its not too much to ask, but does anyone have the time to show and explain to me how to do this? Thanks :)

also, I am quite the beginner when it comes to coding for modded terraria.
 
Back
Top Bottom