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.

Spawning
Fish spawn underwater at a Y level of 12-32.

Cod spawn in normal, cold, and lukewarm oceans, and their deep variants in groups of 4-7.

Drops
Cod drop 1 of their item form when killed:


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

Behavior
Cod tend to swim in schools of fish (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 will not despawn naturally. When that fish bucket is against a block, it empties the bucket, placing water with that fish swimming in it. An empty bucket may be used as well.

Weaknesses
Cod are able to survive out of water. Outside of water, they flop around like guardians for a while until eventually they start to suffocate and die like squid. Cod will flip around on their sides. In Bedrock Edition and Legacy Console Edition, they will rotate when flipping. They cannot swim or breathe in cauldron water.

Fish have a weakness to weapons that have the Impaling enchantment, which also affects squid, turtles, guardians, elder guardians and dolphins.

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