Command block to give specific player (in a certain radius) a status effect
//ads -- adsterra.com -- native banner
?>
In Vanilla Minecraft 1.18, is there a way to give a specific player a status effect if they step within X blocks of an area? I need to give Mining Fatigue on a certain player when they enter my base.
After extensive searching I've looked at the command /effect give
/effect give playerName minecraft:absorption 5 5 true
and also /testfor, but that doesn't seem to work.
The effect should only happen when a certain player is within a certain radius of the command block.
Pictures about "Command block to give specific player (in a certain radius) a status effect"



How do you give specific entities in a specific radius a potion effect?
First off, use the procedure Execute Command / [Command] at x: [x] y: [y] z: [z]. Here are some examples of commands, you can use. This command gives every entity in a 15 block radius poison level 1 for 10 seconds. This command gives every entity except players in a 20 block radius regeneration level 2 for 15 seconds.How do you Testfor a player in a radius?
2. Type the CommandHow do you put status effects on a command block?
Using the effect command in Minecraft In order to give an effect, the syntax is: "/effect give <targets> <effect> [seconds] [amplifier] [hideParticles]". In order to remove an effect, it is: "/effect clear <targets> [effect]".Command Block Tutorials: Radius
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Samson Katt, Leon Natan, Erik Mclean, Jim De Ramos
