You can download Stack Refill on CurseForge and Modrinth:
  CurseForge:   https://curseforge.com/minecraft/mc-mods/stack-refill
  Modrinth:      https://modrinth.com/mod/stack-refill
To keep a better overview of all mods, the issue tracker is located in a separate repository.
  For issues, ideas, suggestions or anything else, please follow this link:
    -> Issue Tracker
Because of the way mod loader files are bundled into one jar, some extra information is needed to do a PR.
  A wiki page entry about it is available here:
    -> Pull Request Information
Requires the library mod Collective.
   This mod is part of The Vanilla Experience modpack and Serilum's Quality of Life Bundle mod.
Stack Refill is a utility mod which automatically refills the itemstack in the player's hand if there is any of the same item in the inventory. It works for weapons in combat, tools used on blocks, stacks when placing blocks, eating food, using potions, tossing items on the ground, drinking milk buckets, when breaking a fishing rod and should work with all modded blocks. One of my personal favourite quality of life tweaks.
Has to be installed on both the client and the server for the best reliance. Can be used server-side only, but this may cause some visual desyncs.
Some GIFs:
A sword being replaced during combat:
A shovel being replaced when digging dirt:
Log blocks being replaced while placing them down:
Bread being replaced after consumption:
Potions being replaced after consumption:
Items replaced after being tossed:
A milk bucket being replaced after being consumed:
Â
A fresh fishing rod after its last use:
When using items on (modded) blocks, such as a sieve from Ex Nihilo:
------------------
You may freely use this mod in any modpack, as long as the download remains hosted within the CurseForge or Modrinth ecosystem.
Serilum.com contains an overview and more information on all mods available.
Comments are disabled as I'm unable to keep track of all the separate pages on each mod.
For issues, ideas, suggestions or anything else there is the Github repo. Thanks!