So I want to make some minigame where players can get a certain item when they get into a specific location, where then they can craft with it and then PVP.

So I thought of using the /execute command to then /give them with that specific coordinate.

/execute @a x y z give @p stick

Putting this in an Always Active Repeating Command Block, it still gives me the item even if I'm not in that location.

How can I give items to a player in they're in the given coordinates?

3 Answers 3


You can use the command:
/execute @e[x=#,y=#,z=#,dx=#,dy=#,dz=#] ~ ~ ~ give @s stick

Substitute the # hashtags for coordinates, and everything prefixed with d for distances.

  • 2
    There's no distance attribute in Bedrock. Also, there's no as component in /execute. Commented Feb 23, 2021 at 17:38
  • Are you sure? this question gaming.stackexchange.com/questions/380383/… seems to say there is, see the command in the question body Commented Feb 23, 2021 at 18:40
  • I am referring to the first part of his sentence about distance, I think distance is shown in that question's body Commented Feb 23, 2021 at 18:44
  • I mean see the command in the question code block right under #town for player 1's selector Commented Feb 23, 2021 at 18:45
  • @RayWu Yes, I see lots of arguments but no distance one.
    – One 2 Many
    Commented Feb 23, 2021 at 18:46

You can accomplish this using two command blocks, one repeating and one chain command block. One way is to put the command blocks under that specific area or another way is to not put it under that specific area but make it act upon the that area.

First, you need to lay out both command blocks assigned to one direction. Then make both blocks “Always Active”. Make the chain command block set to “Conditional”.

Repeating Command Block

Type in /testfor @a[x=?,y=?,z=?,r=?] (if your command blocks are under the specific area, you don’t need to type in the coordinates except the ‘r’ value)

Chain Command Block Or Comparator

For this stage, you can either place a redstone comparator out of the repeating command block activating other blocks or place the chain command block. In the chain command block, just type in /give @p stick


Oh wait, I just realised that a much more easier way to do this is just place a repeating command block that is ’Always Active’ and just type in /give @a[x=?,y=?,z=?,r=?] stick

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .