Enemies spawned from statues cannot drop a dungeon key.
Below is the code that spawns the key drop as you kill an enemy in a biome (the only code that spawns a dungeon key in the game). As you can see, the chance is one in 4000. (On average, every 4000th enemy drops a key.)
I changed the random number to be a confirmed key drop instead, and built a contraption with statues to spawn enemies in an ice biome. I killed a few normally spawned enemies in the biome and all of them dropped a key. Then I spawned a few enemies from the statues and none of them dropped a key.
if (Main.hardMode && this.value > 0f)
{
if (Main.rand.Next(4000) == 0 && Main.player[(int)Player.FindClosest(this.position, this.width, this.height)].zoneJungle)
{
Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1533, 1, false, 0, false);
}
if (Main.rand.Next(4000) == 0 && Main.player[(int)Player.FindClosest(this.position, this.width, this.height)].zoneEvil)
{
Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1534, 1, false, 0, false);
}
if (Main.rand.Next(4000) == 0 && Main.player[(int)Player.FindClosest(this.position, this.width, this.height)].zoneBlood)
{
Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1535, 1, false, 0, false);
}
if (Main.rand.Next(4000) == 0 && Main.player[(int)Player.FindClosest(this.position, this.width, this.height)].zoneHoly)
{
Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1536, 1, false, 0, false);
}
if (Main.rand.Next(4000) == 0 && Main.player[(int)Player.FindClosest(this.position, this.width, this.height)].zoneSnow)
{
Item.NewItem((int)this.position.X, (int)this.position.Y, this.width, this.height, 1537, 1, false, 0, false);
}
}
Best Answer
Unfortunately, all I can tell you is that Random Numbers are Random.
1 in 2500 is... not a whole lot, I'm afraid. And even after killing 2500 mobs, you're not guaranteed one.
So, if there's no way to get better odds, how can we maximize those odds? Simple -- spawn as many mobs as possible, then kill them. The key here, (ha!) is that it doesn't matter what mobs you kill -- Goblin Armies. Celestial Event Mobs. Pirates. Slimes. All are equally valid.
So, things that will help: