I recently made a server and when I got on it with my friend I found that I could not hit anything. I can break blocks but I can't hit any mobs. It is not the modpack because I've tested to see if it was twice in different worlds it's only when I play on the server that this happens. I have checked to see if I had the wrong keybinds and correct game mode everything seems to be alright I don't understand why I cannot hit anything. My friend and I found out that if we died, we were able to attack after that, but after I had changed something minor, it messed up again and no matter how many times I restarted the server or how many times we killed ourselves, we couldn't hit anymore after that. Any solutions?
Also, I doubt it is lag there is no lagging on the server it runs pretty smoothly it's just this one little bug is messing up the whole experience.