Minecraft: How to give an effect to a certain player standing on a block on multiplayer?

//ads -- adsterra.com -- native banner
?>
Hey I am making a multiplayer map and it includes magical blocks that will give you certain effects for example:
/execute @p[r=10000] ~ ~ ~ detect ~ ~-1 ~ wool 15 /effect @p invisibility 12 3 true
which gives invisibility when the "nearest" player stands on it. How can I give the effect to the player who stands on it, not just the nearest player to the commandblock giving the command?
Best Answer
VERSION 1.16+
execute at @a[distance=10000] if block ~ ~-1 ~ [block] run effect give @p [effect] [seconds] [amplifier] true
Pictures about "Minecraft: How to give an effect to a certain player standing on a block on multiplayer?"



How do I trigger command blocks when a player walks in a certain area?
This /effect command uses an ID value of 8, a duration of 50 seconds, and an amplifier of 1. This will give the player called DigMinecraft the effect of Jump Boost II for 50 seconds. The amplifier is used to increase the level of the effect....Add Effect using Effect ID.Effect IDAmplifierResult83Jump Boost IV3 more rowsHow do you give someone an effect in Minecraft?
If want to give multiple blocks at once, you need to specify an Amount in the /give command. The amount goes after the Item that you are giving. Type the command in the chat window and press the Enter key to run the command.How do you give a player a command block with multiple players?
2. Type the CommandHow To Detect When A Player Is Standing On A Block In Minecraft || Insta Kill Or Launch Pad
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Oliver Sjöström, cottonbro, RODNAE Productions, cottonbro