Mouse Movement

Mouse movement represents the instant displacement of the cursor on the screen (in pixels) : ($dx,dy$ ).

When it comes to Minecraft, mouse movement represents the instant rotation of the camera (in degrees) : ($\Delta x, \Delta y$ ).

Sensitivity
Sensitivity (s) is a parameter that changes how fast the camera should turn.

This setting can be changed in the Controls menu.


 * The default sensitivity is "100%" ($s=0.5$ )


 * The lowest vanilla sensitivity is "0%" ($s=0.0$ )
 * The highest vanilla sensitivity is "200%" ($s=2.0$ )

In 1.8, $\Delta x$ is calculated as:

$$\Delta x = 1.2dx \times (0.6s + 0.2)^{3}$$

$\Delta y$ is obtained in the same way, and is multiplied by -1 if "Invert Mouse" is ON.

With default sensitivity ($s=0.5$ ), one pixel of mouse movement translates into 0.15° of rotation.

This means that the camera moves in increments of 0.15°: to turn 45°, you would need to move your mouse by 300px.

Furthermore, s isn't technically bounded by [0,1], and can take any value (even negative).

You can manually edit the value of mouseSensitivity in the options.txt file (found in the .minecraft folder)

Be warned that modifying the options.txt file may or may not be allowed on servers.

Remarkable values
Since it's possible to set the sensitivity to any value we want, it might be interesting to adjust the sensitivity to match specific rotation increments.

To get the required sensitivity for the desired increment $\delta$, we can use the inverse formula:

$$s = \frac{\sqrt[3]{\frac{\delta}{1.2}} - 0.2}{0.6}$$

This table lists remarkable increments of rotation, and the corresponding values of s.

Yaw and Pitch
Yaw (horizontal rotation) and pitch (vertical rotation) are floats that keep track of an entity's spatial rotation.

Facing is the restriction of the yaw to [-180, 180], as it is represented in F3. Pitch is naturally restricted to [-90, 90].

Mouse movement directly modifies the Player's yaw and pitch:

While the pitch is clamped between -90° and 90°, yaw is not clamped between -180° and 180° as would be expected.

This means that yaw is unbounded, which has some unintended consequences if you deliberately turn in one direction for long enough.

By nature of being a float, its precision becomes worse the bigger it gets, to the point where it becomes noticeably jittery at large values.


 * When $$|yaw| > 4194304$$ ($2^{22}$ ) it can only increase in increments of 0.5°.
 * When $$|yaw| > 8388608$$ ($2^{23}$ ) it can only increase in increments of 1°.

At some point, yaw can even mess with movement and stop the player in place.

This is because the yaw gets too large to be converted to a proper angle (see Angles).

This phenomenon happens when $$|yaw| \geq 11796480 = 360 \times 2^{15}$$.

Turning even further can crash the game, when $|yaw| > 8.59 \times 10^9$