Cod

"You're not the only new explorer of the updated oceans, mind. We've filled the seas with new types of fish! Above is the delightful pufferfish, which filled me with delightful poison because I was too busy taking that screenshot to swim away in time :("

- Tom Stone

Cod are common passive mobs found in oceans.

Java Edition
Cod spawn underwater in normal, cold, lukewarm oceans, and their deep variants, in groups of 3-6.

Bedrock Edition
Cod spawn underwater 12-32 blocks away from the player in normal, cold, frozen, lukewarm oceans, and their deep variants, in groups of 4-7. In addition, cod spawn only on the surface; that is, there must not be a spawnable block above the spawn location with a non-solid block on top.

Drops
Cod drop the following upon death:


 * 1 (1  if killed while on fire $$)
 * 1 (5% chance)
 * 1–2 s (25% chance)
 * when killed by a player or tamed wolf.

Behavior
Cod tend to swim in schools (a maximum of nine cod per school).

The player may collect a cod by a water bucket on it, which gives the player a bucket of fish. Cod placed with buckets do not despawn naturally. When that fish bucket is on a block, it empties the bucket, placing water with the cod swimming in it.

An empty bucket may be used as well.

Weaknesses
Cod are not able to survive outside of water. Outside of water, they flip around on their sides like guardians for a while trying to get back into the water until, after 10 seconds of time, they eventually start taking suffocation damage and die like squid. $$, they rotate when flipping when out of water. They cannot swim or breathe in cauldron water. They can swim in, but cannot survive in waterlogged blocks, most noticeably waterlogged slabs and stairs.

Cod are affected by the Impaling enchantment, like squid, turtles, guardians, elder guardians, dolphins, and all other types of fish (salmon, pufferfish, and tropical fish).

Entity data
Cod have entity data associated with them that contain various properties of the mob.