Command block to give specific player (in a certain radius) a status effect

Command block to give specific player (in a certain radius) a status effect - Cheerful crop African American female owner giving treat to Labrador Retriever while teaching commands in park

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"

Command block to give specific player (in a certain radius) a status effect - Dog giving paw to anonymous person
Command block to give specific player (in a certain radius) a status effect - Blue brick wall with uneven surface
Command block to give specific player (in a certain radius) a status effect - Two Men Playing Volleyball Near Red Canopy



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 Command
  • Test if Players are within 10 blocks. In this example, we will test to see if there are any players within a 10 block radius with the following command: /testfor @a[r=10] ...
  • Test if Mooshrooms are within 50 blocks. ...
  • Test if Nearest Player is at Level 20 experience.


  • How 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