I am trying to detect if an item is near a player. How can I do this? Also, if possible, how do you in general detect the proximity of two entities?


You can test for items nearby a player

/execute @a ~ ~ ~ testfor @e[r=RADIUS]

For other commands just use the r=RADDIUS selector.

| improve this answer | |
  • But how could I detect which player dropped the item. Sorry for not mentioning this in the question. Could I set a score (scoreboard) to the player? – jdoe May 30 '16 at 20:37
  • Actually, I thought of a way how to accomplish what I wanted. Thanks anyway!!! – jdoe May 30 '16 at 20:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.