You need to use "execute if entity @p[distance=..3]". The key is the "..". Without that, the command will only execute if there is a player that is exactly 3 blocks away, which is virtually impossible. The ".." before the "3" means "less than or equal to", which should fix your problem. If you use, ".." after the "3", it will mean "greater than or equal to".
...
You can also use this to define number ranges. For example "2..3" means "in between 2 and 3", and it is inclusive on both sides.
A range such as "y..x" would mean "in between y and x", instead of "y is greater than x". You are defining a number range, not a condition.
Technically, if you didn't specify a number on both sides, Minecraft would assume the highest or lowest number possible. If we represent the maximum number with "infinity", "..3" would be equal to "-infinity..3" and "3.." would be equal to "3..infinity". Minecraft allows you to omit one side of the range for convenience.
That's from when I helped someone else with the same problem.
Rollback Post to RevisionRollBack
Remember those versions that minecraft pranked us with? Specifically:
Minecraft 2.0
Minecraft 1.VR-Pre1
Snapshot 15w14a
Minecraft 3D
Those are still downloadable! Watch this video for 2.0:
To download the other ones you need to make a folder in the versions folder for minecraft and put the client and JSON file for the versions in there. They all need to be named the same aside from file extensions. Once you do that, you will be able to choose that version when making a new profile with the minecraft launcher.
/execute at @e[type=minecraft.bat] run effect give @p[distance=10] minecraft:haste 5 2 true
It doesnt work for some Reason, nothing happends.
Anyone that can give me a good Alternative?
That's from when I helped someone else with the same problem.
Remember those versions that minecraft pranked us with? Specifically:
Those are still downloadable! Watch this video for 2.0:
https://www.youtube.com/watch?v=PQdu9LKAdIU
To download the other ones you need to make a folder in the versions folder for minecraft and put the client and JSON file for the versions in there. They all need to be named the same aside from file extensions. Once you do that, you will be able to choose that version when making a new profile with the minecraft launcher.
15w14a is on this link:
http://minecraft.gamepedia.com/15w14a
1.RV-Pre1 is here:
http://minecraft.gamepedia.com/1.RV-Pre1
Minecraft 3D is here:
https://minecraft.gamepedia.com/Java_Edition_3D_Shareware_v1.34
Thx I will try this out soon