0

I'm almost done my map, but I'm having a problem with my /give commands.

When you use @p to select the nearest player to give items to, it selects the nearest player to the command block. The problem is, the nearest player isn't always the activating player, i.e., the player that activated the command block.

How can I make sure that the item is given to the person who triggered the command block, who may not always be the nearest player?

0

If possible, you can use tags (I hope you know about tags).

So, you can put a pressure plate and in that command, attach/give the tag to the user in a map.
Then, you can just give it to /give @a[tag=<yourtagname>]

I guessed this helped you.

P.S. I'm new to Minecraft and I have tried it beforehand as I can't trust my logic before testing.

3
  • You can try it as im not like 100% sure i think it works :D Oct 21 '21 at 8:29
  • 2
    Welcome to Arqade! It might be helpful to link in some references to wikis, in case people that find this answer don't know how to use tags, etc. It can also be helpful to show a full command, including how to assign tags.
    – Ben
    Oct 21 '21 at 9:11
  • thanks it worked
    – Noah A.
    Oct 23 '21 at 8:51

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.