Sure, I will try that.
However this doesn't solve anything. This isn't how mending is meant to work as far as I'm aware.
Do you have any ideas about the mob spawns?
Have you checked that you are in the mob spawn area? Because you may have changed it in the settings (it is useful to reduce the spawn area of the mobs because it reduces the lag).
I read now your first post. Try to use a normal sword for attack the mob and put the sword with Mending in second hand
Furthermore, it controls the lighting level in the surrounding area.
P.S. I don't take responsibility for any errors in the post.