In Vanilla Minecraft 1.18, is there a way to give a specific player a status effect if they step within X blocks of an area? I need to give Mining Fatigue on a certain player when they enter my base.
After extensive searching I've looked at the command
/effect give playerName minecraft:absorption 5 5 true
/testfor, but that doesn't seem to work.
The effect should only happen when a certain player is within a certain radius of the command block.