Take damage when far from someone

Is there any way to make people take damage if they’re far away from someone without the worldborder? Only reason I can’t use the world border is because it doesn’t work in other dimensions very well.

Continue to help post