In a given location, how can I give a player some item?

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.


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