[Bug] NoteScreen crash — setScreen called on wrong thread
Summary
Game crashes with IllegalStateException when opening the NoteScreen (sneak + right click with Note item). Fabric Screen API detects that setScreen was called off the render thread.
Exception
java.lang.IllegalStateException: [fabric-screen-api-v1] The current screen
(dev.doctor4t.wathe.client.gui.screen.ingame.NoteScreen) has not been correctly initialised,
please send this crash log to the mod author.
This is usually caused by calling setScreen on the wrong thread.
Root Cause
In NoteItemMixin.java#L23-L28:
@Inject(method = "use", at = @At("HEAD"))
private void useClient(World world, PlayerEntity user, Hand hand, ...) {
if (!user.isSneaking()) return;
MinecraftClient.getInstance().setScreen(new NoteScreen()); // ← not on render thread
}
Item#use may be called off the render thread, but setScreen must run on the render thread.
Suggested Fix
MinecraftClient.getInstance().execute(() -> {
MinecraftClient.getInstance().setScreen(new NoteScreen());
});
Steps to Reproduce
- Launch modpack The Last Voyage of the Harpy Express (v1.3.2) on MC 1.21.1
- Enter a world (integrated server, 6 players online)
- Sneak + right click while holding a Note item
- Game crashes immediately
Environment
| Item |
Detail |
| Wathe |
1.3.2-1.21.1 |
| Minecraft |
1.21.1 |
| Fabric Loader |
0.17.2 |
| Fabric API |
0.116.7+1.21.1 |
| Java |
21.0.7 (Azul OpenJDK) |
| OS |
Windows 11 |
Full Report
📎 Full crash report, game log, and detailed analysis:
https://github.com/VincentZyu233/wathe-notescreen-crash-report-20260212
[Bug] NoteScreen crash —
setScreencalled on wrong threadSummary
Game crashes with
IllegalStateExceptionwhen opening the NoteScreen (sneak + right click with Note item). Fabric Screen API detects thatsetScreenwas called off the render thread.Exception
Root Cause
In
NoteItemMixin.java#L23-L28:Item#usemay be called off the render thread, butsetScreenmust run on the render thread.Suggested Fix
Steps to Reproduce
Environment
Full Report
📎 Full crash report, game log, and detailed analysis:
https://github.com/VincentZyu233/wathe-notescreen-crash-report-20260212