FavoriteItems - Protection for Valuable Items
Have you ever accidentally thrown away your best sword or dropped a pickaxe into lava along with unwanted cobblestone? This mod was created exactly for such situations! Plus, it works only on the client side.
This modification allows you to add any items to the favorites list by simply pressing the F key when hovering the cursor. The system remembers items by their name - if you added cobblestone to favorites, then all cobblestones in the inventory will be protected. For more precise control, you can edit the favorites list file, adding names with wildcards or full regular expressions (the file is located at .minecraft/favorites/[World Name].txt or .minecraft/favorites/[Server Name]-[Server IP].txt).
After adding an item to favorites, it can only be moved by regular click-click - Shift+click doesn't work, and it cannot be thrown away. If you have a favorited item on your cursor when closing the inventory, the mod will attempt to place it in the inventory first.
A feature of working with protected items is that the standard version of Inventory Tweaks may loop when trying to sort them. To solve this problem, there is a special version of Inventory Tweaks that also allows adding sorting rules by item name using quotes, for example: D2 "MyItemName".
For Inventory Tweaks to work correctly on servers with this modification installed, you need to change the setting enableServerItemSwap=true to enableServerItemSwap=false in the InvTweaks.cfg file.