Crates

Crates are grab bag-type items that can be caught during Fishing, each containing random loot such as ores and bars, restorative and buff potions, etc. In addition, biome-specific crates can contain biome-specific loot, such as a Lucky Horseshoe from a Sky Crate or a Staff of Regrowth from a Jungle Crate. They can be right-clicked from within the player's inventory to unload their contents. They can also be placed, though doing so will make the loot unvailable until the crate is retrieved and consumed. Wooden Crates are about twice as common as Iron Crates, which in turn are around four times as common as Golden Crates. Rarer crate types contain more valuable loot. Each Crate type can be stacked up to 99 in a single inventory slot.

If fishing in water, and if the condition is suitable to not harvest junks (Old Shoes, Sea Weed, or Tin Can) and the line never breaks, there are 10% chance to harvest crates normally, and 20% when used with a Crate Potion. When it decides to harvest crates, there are complex algorithms to decide which type of crate it turns out to be. The priority of crate types are:

Gold > Biome-themed > Iron > Wooden

And what the Biome-themed Crate turns out to be is decided by whether the player's surrounding satisfies the biome criteria. The priority inside are:

Corruption > Crimson > Hallowed > Dungeon > Jungle > Sky

For example, when a Floating island is so corrupted that it satisfies corruption criteria, Sky Crates will no longer be harvested. See Crates for extended information.

Trivia
It's improbable to be a reference, but the crate's sprite resembles Weighted Storage Cubes from Portal franchise. This can be used in making adventure maps.