Librarians are considered by many to be the best Minecraft villagers because their trades routinely offer rare items.
They trade for paper and other easily acquired items in exchange for enchanted books, sometimes having three separate books available.
Mending is one of the best enchanted books available and it's useful for almost all items, making it a highly sought after artifact in Minecraft. The odds of acquiring it from fishing or a loot chest are really slim, so finding a villager that trades it is a huge victory for Minecraft players.
Getting a villager to sell mending books in Minecraft
The short answer as to how to get a mending villager is simply trial and error. They can be found in villages, but it's much easier to deal with them if they're in a confined space.
Once the villager(s) is confined, it will take the first available job block, so players should ensure that there are none nearby. Turning them into a librarian will require a lecture.
Having a bed also helps as once their trades are set, they can sleep and restock them.
A lecturn is crafted with four wooden slabs and a bookshelf. Place the item next to the villager and it should turn into a librarian. Check the trade by clicking on it. Players can even determine whether or not it's a book.
All books are available through trade, so the odds of discovering Mending I are fairly low. If it's a bookshelf or book that isn't Mending I, then players need to exit and break the lecturn.
After that, repeat the entire process by placing the lecturn and checking again. Once players do arrive at a Mending I trade, they should be aware that the price may be steep.
It is possible to repeat the process until the player gets Mending I for a low price, but it may take a long time. With that being said, taking the first option is probably best.
Once the Mending I trade is found, Minecraft players can lock it in by either trading for the book (which costs emeralds and a regular book) or by trading the paper for an emerald (usually 26 pieces of paper). This will lock the trade in, ensuring its availability until the villager is alive.