This is caused by Wayland not using window icons the same way most protocols do and the game trying to set it anyway. There's nothing there to stop the game from calling GLFW#glfwSetWindowIcon while Wayland is in use which just causes the game to crash almost as soon as it starts.
This bug was reported almost ten years ago and is still an issue in release 1.20.4. It's easy to fix; all that has to be changed to correct the bug is to add these two if statements/branches to the method checkHotbarMouseClicked
inside the AbstractContainerScreen
class.
Edit: Updated the code snippet with things that I have noticed since initially writing this
// Add this to the beginning of the method
if (this.minecraft.options.keyInventory.matchesMouse(button)) {
this.onClose();
return;
// Add this to the first nested if statement
} else if (this.minecraft.options.keyDrop.matchesMouse(button)) {
this.slotClicked(this.hoveredSlot, this.hoveredSlot.index, hasControlDown() ? 1 : 0, ClickType.THROW);
return;
Can confirm in 1.20.4. This also happens when teleporting a player server side via `ServerGamePacketListenerImpl.teleport`.