With your current setup, any players that are exactly 5 blocks away will gain blindness. To make it so that any players within 5 blocks get the effect, make it distance=..5. The .. makes it any players in the radius of up to 5, instead of exactly 5 blocks away. Similarly, if you want to make it so that any players 5 blocks or farther get an effect, all you would have to do is make it distance=5..
The command I've tried to use it:
/execute if entity @p[distance=5] run effect give @p minecraft:blindness 1 1 true
I would like to give any player within a 5 block radius permanent blindness until they leave the area.]
If someone could correct me where I've gone wrong it would be much appreciated
With your current setup, any players that are exactly 5 blocks away will gain blindness. To make it so that any players within 5 blocks get the effect, make it distance=..5. The .. makes it any players in the radius of up to 5, instead of exactly 5 blocks away. Similarly, if you want to make it so that any players 5 blocks or farther get an effect, all you would have to do is make it distance=5..
Hope this helps!
Memelord and general minecraft enthusiast
Thank you so much I've got what i want working now this has helped a lot