Compatibility
Minecraft: Java Edition
Platforms
Supported environments
Tags
Creators
Details
FixCursor
The cursor lands in a random spot when you open your inventory. This fixes it.
You know the one. You alt-tab, come back, press E, and the mouse is somewhere off in
a corner — or on your second monitor. You have to go find it before you can click
anything. That is MC-261980, and it has been
around for years.
FixCursor puts the cursor where it belongs. Client-side, no server component, nothing else touched.
Two modes
| Mode | What it does |
|---|---|
| Centre (default) | Every container opens with the cursor in the middle of the window. The reliable version of what vanilla already tries to do. |
| Restore | Remembers where the cursor was when you last closed a given screen, and puts it back there next time. |
In Restore mode the inventory, a chest and a crafting table each keep their own position, and positions are stored as a fraction of the window (0..1) — so changing GUI scale, resolution or window size does not throw them off.
Why vanilla gets it wrong
The call order is inverted. Vanilla sets the cursor position while the cursor is still captured, and only releases it afterwards:
GLFW.glfwSetCursorPos(handle, x, y); // cursor still captured
GLFW.glfwSetInputMode(handle, GLFW_CURSOR, mode); // released only now
GLFW drops a position that is set while the cursor is captured. The call silently does nothing, the mode switches without coordinates, and the cursor shows up wherever the OS last left it. FixCursor swaps the two calls for the released modes and leaves the capture path untouched. Verified against the 1.21.11 client bytecode.
Client-side only
- No packets. Nothing is sent to the server.
- No item, inventory or click-timing logic.
- No gameplay changes of any kind.
- Works on any server, vanilla or modded.
The only calls it makes are glfwSetCursorPos, glfwSetInputMode, glfwGetCursorPos,
glfwGetWindowSize and glfwGetInputMode. If you have ever hesitated over a cursor mod
because of anticheat: there is nothing here for one to look at.
Requirements
| Minecraft | 1.21.11 |
| Fabric Loader | 0.19.2+ |
| Java | 21+ |
| Fabric API | required |
| Mod Menu | required |
| Cloth Config API | required |
Mod Menu and Cloth Config are hard requirements because they are the only way to change the mode in game.
Configuration
Everything lives in Mod Menu → FixCursor. Two extra toggles:
- Remember per screen type — on by default. Turn it off for one position shared by every screen.
- Apply to every screen — off by default. Container screens are the ones that matter; turn this on if you also want it on chat and menus.
Settings are stored in config/fixcursor.json. In Centre mode the mod never writes to
disk at all. Delete the file to forget every stored position.
License
MIT.
Курсор улетает в случайное место при открытии инвентаря. Это лечит.
Знакомая ситуация: свернул игру, вернулся, нажал E — а мышь где-то в углу или
вообще на втором мониторе. Это MC-261980,
и живёт он годами.
FixCursor ставит курсор туда, где ему место. Только клиент, никакой серверной части.
Два режима:
- Центр (по умолчанию) — каждый контейнер открывается с курсором в середине окна. Надёжная версия того, что ваниль и так пытается сделать.
- Восстановить — помнит, где курсор был при закрытии конкретного экрана, и возвращает его туда в следующий раз. Инвентарь, сундук и верстак помнят каждый своё.
Позиции хранятся в долях окна (0..1), поэтому смена GUI scale, разрешения и размера окна их не сбивает.
Почему ваниль ломается: порядок вызовов перевёрнут — позиция ставится пока курсор ещё захвачен, а GLFW такую позицию отбрасывает. Вызов молча проваливается, и курсор появляется там, где его оставила ОС.
Только клиентская часть: ни пакетов, ни логики предметов и инвентаря, ни таймингов кликов. Работает на любом сервере.
Требуется: Minecraft 1.21.11, Fabric Loader 0.19.2+, Java 21+, Fabric API, Mod Menu и Cloth Config API — последние два обязательны, через них переключается режим.
Настройки: Mod Menu → FixCursor.


