Inventory Sorter 1.18.1/1.16.5/1.12.2 the mod has already offered a few simple inventory sorting tweaks. It is available for you to experience the entire features right here.

Inventory Sorter Features
Here are the main features that you can find.
Some simplistic inventory sorting tweaks
Middle-click sorts, mousewheel in and out of inventory one item at once
Note! The default keybindings for the mousewheel actions are the wheel. If you set them to something else, please establish again to restore the wheel operation.
Version 1.13 command:
/inventorysorter
It works with the last container you middle-click sorted. It helps you manipulate the container blacklist. They are containers that don’t fit middle-click sorting for one reason or another.
bladd: supplements the final tank to the blacklist
blremove: deletes the last container from the blacklist
show: displays the last container arranged
list: shows the list of blacklisted containers
Inventory Sorter is a miscellaneous mod. It requires Minecraft Forge.
Screenshots