Updated for Minecraft Paper Servers 26.1.2
InventorySortListener.java Sound.UI_BUTTON_CLICK → Sound.UI_LOOM_SELECT_PATTERN (UI_BUTTON_CLICK was removed in 1.21.x)
isPlayerInventoryView() rewritten Old: fragile string hacks (.name().contains("CRAFTING")) New: clean InventoryType enum comparison
instanceof Player guard added to onInventoryClick (event.getWhoClicked() can theoretically be non-Player) buildItemComparator() — added null-check on meta.displayName() (displayName() can return null in 1.21.4 if not explicitly set) PlainTextComponentSerializer import made explicit (top-level import)
SortCooldownManager.java BukkitTask field added to hold cleanupTask reference cleanup() now cancels the task cleanly before clearing maps startCleanupTask() stores return value in cleanupTask field
plugin.yml version bumped to 1.2.0 to reflect the update
Updated InventorySortListener to improve item stacking and sorting functionality, including handling of filled maps and action bar messages.
📦 InventoryAutoSort
A lightweight, hotbar-safe inventory sorting plugin for Minecraft Paper servers. Sort and stack your entire backpack with a simple double right-click on any empty slot — no commands, no hassle.
✨ Features
🖱️ Double right-click any empty inventory slot to sort
📚 Auto-stacks duplicate items before sorting
🔒 Hotbar preserved — slots 0-8 are never touched
🎒 Container support — sorts chests, barrels, and other containers
⏱️ Sort cooldown — prevents spam sorting
🔕 Toggle support — players can disable sorting for themselves
🧺 Bundle compatible — right-clicking with a bundle works normally
⚡ Lightweight — no dependencies, no database, no config bloat
🎮 How To Use
Open your inventory
Right-click an empty slot once (you'll hear a click sound)
Right-click the same empty slot again quickly
✅ Your backpack is now sorted and stacked!
Your hotbar is always safe and will never be reordered.
🔧 Installation
Download the latest .jar from Releases
Drop it into your server's /plugins folder
Restart your server
That's it — no configuration needed!
🔑 Permissions
inventoryautosort.use
Allows a player to use inventory sorting true
🗂️ Sorting Behavior
Player inventory: Sorts backpack (slots 9-35) only
Hotbar (slots 0-8): Never touched
Chest / Barrel / Container: Entire container is sorted
Duplicate item stacks: Merged before sorting
Named / enchanted items: Only merged with identical copies
Bundles on cursor: Right-click works normally

A lightweight Paper plugin that sorts and stacks your inventory with a simple double right-click. Hotbar safe!