Back to 9Minecraft
Wiki 9Minecraft Wiki 9Minecraft
Cursor Centered Fix Wiki › Guides › How to Set Up Wayland Cursor Centering with ydotool

How to Set Up Wayland Cursor Centering with ydotool

On Wayland, Minecraft cannot move the system cursor directly, so this mod uses ydotool to reposition it programmatically. Without this setup, centering will silently fail on Wayland sessions.

Install and Enable ydotool

Install ydotool through your distribution's package manager if available, or build it from source if your distro does not package a recent version. Once installed, the ydotool daemon must be running — start it and enable it so it launches automatically. Verify it works by running a simple ydotool command from a terminal; if the cursor moves, the daemon is functioning.

Grant Permission Without Password Prompts

By default, moving the cursor via ydotool may require elevated privileges. Configure a sudoers rule that allows your user to run the specific ydotool command without a password prompt. Keep the rule narrow — only the exact command needed — rather than granting blanket sudo access. After editing sudoers, test in a terminal that the command runs without asking for a password.

Confirm In-Game

Launch Minecraft, open a GUI, and watch the cursor. It should jump to center. If it does not, check that the daemon is running, that the sudoers rule matches the command the mod invokes, and that you are genuinely on a Wayland session rather than X11.