Repository navigation
[26.3][NeoForge] Sorting does nothing: NoClassDefFoundError net/neoforged/neoforge/items/SlotItemHandler #82
Description
Environment
- Minecraft 26.3, NeoForge 26.3.0.65-beta (also reproduced by inspecting every build from 26.3.0.2-beta up to 26.3.0.76)
- Inventory Essentials 26.3.0.4 (neoforge), Balm 26.3.0.3
- Multiplayer, mod installed on both sides
Symptom
Middle-click (or any key bound to Sort Inventory) does nothing in chests or the player inventory. Ctrl+click single transfer works. Rebinding the key and removing JEI made no difference.
Cause
NeoForgeInventoryEssentials$1.isSameInventory does targetSlot instanceof SlotItemHandler. net.neoforged.neoforge.items.SlotItemHandler was deleted in NeoForge PR neoforged/NeoForge#3489 ("[26.3] Clean up deprecations", merged 2026-09-16). It is present in 26.3.0.0-beta and 26.3.0.1-beta only; every later build throws NoClassDefFoundError the first time the method runs. On the client that is ClientInventorySorting.sort; on the server the same helper is reached from BulkTransferAllMessage and BulkTransferSingleMessage.
The mod's gradle/libs.versions.toml on the 26.3 branch still pins neoForge = "26.3.0.0-beta", which is why it compiled.
Client log
net.minecraft.ReportedException: mouseClicked event handler
at net.minecraft.client.MouseHandler.onButton(MouseHandler.java:123)
...
Caused by: java.lang.NoClassDefFoundError: net/neoforged/neoforge/items/SlotItemHandler
at net.blay09.mods.inventoryessentials.neoforge.NeoForgeInventoryEssentials$1.isSameInventory(NeoForgeInventoryEssentials.java:21)
at net.blay09.mods.inventoryessentials.InventoryUtils.isSameInventory(InventoryUtils.java:32)
at net.blay09.mods.inventoryessentials.client.sorting.ClientInventorySorting.sort(ClientInventorySorting.java:48)
at net.blay09.mods.inventoryessentials.client.ClientOnlyInventoryControls.sort(ClientOnlyInventoryControls.java:459)
at net.blay09.mods.inventoryessentials.client.ModKeyMappings.lambda$initialize$18(ModKeyMappings.java:94)
at net.blay09.mods.inventoryessentials.client.ModKeyMappings.handleSlotInput(ModKeyMappings.java:161)
at net.blay09.mods.kuma.AbstractManagedKeyMapping.handleScreenInput(AbstractManagedKeyMapping.java:105)
at net.blay09.mods.kuma.neoforge.NeoForgeKumaAPI.lambda$new$10(NeoForgeKumaAPI.java:149)
at net.neoforged.neoforge.client.ClientHooks.onScreenMouseClickedPre(ClientHooks.java:476)
at net.minecraft.client.MouseHandler.onButton(MouseHandler.java:109)
Caused by: java.lang.ClassNotFoundException: net.neoforged.neoforge.items.SlotItemHandler
Suggested fix
Drop the SlotItemHandler branch in NeoForgeInventoryEssentials.isSameInventory and isSortableSlot (the ResourceHandlerSlot branch already covers the new transfer API), and bump the NeoForge build in libs.versions.toml so the removal is caught at compile time.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fields🎉 Done
Activity
fix: Fix sorting not working on newer NeoForge versions #82