Normally, when multiple items are eligible for Mending, vanilla picks a random item with the enchant and attempts to repair it.
This is undesirable because often the item selected for mending may not need it, or worse yet, might already be fully repaired already.
This mod fixes this by doing 2 things:
1. If any eligible items with Mending are damaged, 100% of the xp will be used to repair them.
2. The item with the highest damage/durability ratio is chosen first.
Demonstration:

This mod can be used serverside only, but also works in single player.

