Swimming

Swimming is a form of transportation that allows the player to move in water.

Control
Swimming is activated by pressing while in water.

Sprint-swimming can also be activated.. To do this, the player can press for 1 block gap while moving, or double tap. The player cannot sprint-swim if their hunger bar is at or below with water Source.

Usage
When swimming on the surface of still water, the player will move at 2.20 blocks per second. If the player is partially submerged in water, they will move at 1.97 blocks per second. The player will move at 1.81 blocks per second when swimming downstream underwater, and will move at a faster 0.39 blocks per second while swimming upstream underwater.

Sprint-swimming
Swimming allows the player to move at around 5.612 meters/second, which is 30 percent faster than the normal walking speed of around 4.317 m/s. The player can turn while sprinting, which will slightly reduce their speed. Sprinting will also increase the speed of flying in Creative mode, and the speed of swimming. Although “sprinting” while increases the field of vision like actual sprinting, it does not increase the entity's speed. However, one can acelerate a swimming by pressing the boost button.

While sprinting, it is possible to swim across the water horizontally, instead of the usual two blocks, though sprinting will not cause the player to swim higher.

Sprinting will reduce the player's saturation, and once their saturation is 0 it will deplete the hunger bar at a rate of $1/2$ every 40 meters, or 7 seconds.

Swimming produces particles at the player's feet corresponding to the block type they are running on. Also, when a player attacks any mob (excluding squid and Fish mobs, Turtle) while sprinting, the mob suffers a larger knockback than usual. Sprinting and holding down jump at the same time is usually faster, but actually becomes slower when under the effect of a high level speed potion.

Sprinting ends when the player collides with a solid block, sneaks, blocks or attacks a mob. If none of these happen, the player will automatically stop sprinting after 30 seconds. Sprinting will also end if the hunger bar lowers to or below.

Trivia

 * Sprinting and jumping while under a 1 block gap high ceiling causes a player to move at a speed almost twice as fast as regular sprinting speed, but it will consume a hunger point every second.
 * This can be sped up even more by decreasing the ceiling height using water source or by sprinting on ice.
 * A similar effect occurs if the player sprints and rapidly hits at the same time on a set on fish mobs.