Hi, I'm horrible at command blocks, but how do I (as a player) give the effect of darkness of a few seconds everytime another players comes near me in the radius of 10 blocks?
* Upvote this comment if this is a good quality post that fits the purpose of r/Minecraft
* Downvote this comment if this post is poor quality or does not fit the purpose of r/Minecraft
* Downvote this comment *and report the post* if it breaks the [rules](https://www.reddit.com/r/Minecraft/wiki/rules)
----
(*Vote has already ended*)
PlasmaTurtle212025-11-25 16:36
For Java or Bedrock?
For bedrock use:
execute as <your ign> at @s run effect @a[rm=0.001,r=10] darkness <time> <intensity> <boolean:true/false>
(Replace the words in <> with your preference of data, for time and intensity use any whole numbers, for true or false just put true if you want particles to show visible when a player is affected with the darkness effect)
For Java use:
execute as <your ign> at @s run effect give @a[name=!<your ign>,distance=0..10] darkness <time> <intensity> <boolean:true/false>
(I don’t really do Java so the command could be wrong.)
Lmk if you have further questions
Martyty65472025-11-27 07:41
Thank you so much! I will try it today and let you know
Commentaires
* Downvote this comment if this post is poor quality or does not fit the purpose of r/Minecraft
* Downvote this comment *and report the post* if it breaks the [rules](https://www.reddit.com/r/Minecraft/wiki/rules)
----
(*Vote has already ended*)
For bedrock use:
execute as <your ign> at @s run effect @a[rm=0.001,r=10] darkness <time> <intensity> <boolean:true/false>
(Replace the words in <> with your preference of data, for time and intensity use any whole numbers, for true or false just put true if you want particles to show visible when a player is affected with the darkness effect)
For Java use:
execute as <your ign> at @s run effect give @a[name=!<your ign>,distance=0..10] darkness <time> <intensity> <boolean:true/false>
(I don’t really do Java so the command could be wrong.)
Lmk if you have further questions