Crab

Crabs are neutral mobs that spawn in beaches and swamps.

Appearance
Crabs appear to be based on the red land crab, and although they always have yellow eyes, their shells come in 4 different colors: red, pale red, brown, and blue.

Behavior
Crabs are very skittish when unprovoked, and will flee from any player that gets within 7-20 blocks away from them; however, if provoked by a player or another mob, they will instead start rapidly scuttling at them and dealing 3 hearts (6 HP) of damage upon contact. Otherwise, they act similarly to most other passive mobs, aimlessly crawling around at a a slow pace, and avoiding any natural hazards such as lava; occasionally, they will clack their claws. As well as this, unlike most mobs, they cannot swim, and will sink in the water; however, they are still capable of moving around in and underwater, and are immune to drowning.

If a certain music disc is inserted into a jukebox, any nearby crabs will change their behavior accordingly.

History

 * 7.0.0:
 * Introduced.
 * 8.2.0:
 * No longer despawns by default.
 * 10.0.0:
 * Now has a 25% chance to spawn as a baby crab.

Trivia

 * Crabs behave very similarly to horseshoe crabs, as they are both slow-moving amphibious mobs that gain a drastic increase in speed when fleeing from players. This is because the two mobs share AI code.
 * However, crabs retaliate against attackers, while horseshoe crabs do not. As well as this, crabs flee from targets slightly faster than horseshoe crabs do.