This guide will let you know how to get a Mending villager in Minecraft.
To get a mending book from the villager, you will need to make a build, as shown in the image below.
After that, you need to place pistons in it
And then remove a dirt block from the middle.
The next you have to do is place a piston there.
Then you need to put buttons on both the pistons.
Now you need to break the above blocks, as shown in the image below.
And put a temporary block above the piston
Then you need to put a villager inside which should not be a baby villager or the green villager and cover it with the block. Then you need to place the bed on the side of the building and villagers should be connected to it.
After that, break the temporary block in front of the villager and then place a lectern in front of it and make sure the villager is connected to it.
Now you need to check which thing the trader is trading. If it is not the mending book, then you should press the lower piston and reset the trade, and when the villager is connected to the lectern, you need to check the trade again. Keep on doing it unless it gives you what you want which is the mending book.