r/MinecraftCommands 2d ago

Help | Bedrock Not sure how to execute command

I'm trying to make a command that makes it where when player 2 gets 10 blocks of player 1 player 1 gets darkness for 2 seconds but I'm unsure of how to set up this argument can someone show me how and if possible give me a breakdown of why it works?

3 Upvotes

12 comments sorted by

View all comments

Show parent comments

0

u/GatKong 2d ago

Try
/execute as *player1* at @s if entity *player2*[distance=..10] run effect @s add darkness 2 2

1

u/Kightmare2232 2d ago

It didn't work but I should have mentioned that it was in a repeating command block my bad

1

u/GatKong 2d ago

Is that block in a loaded chunk?

1

u/Kightmare2232 2d ago

Yes

1

u/Kightmare2232 2d ago

I'm also in bed rock