0

I am making a Minecraft commands map and need to give a random player two effects and one item.

I understand that each effect/item needs to be given in a separate command. The problem is, @r targets a random player each time, but I need the effects and items to be given to the same randomly targeted player.

How can I give these effects/items to the same player?

0
2
  1. Tag the random player.
    /tag @r add RandomSelection 
    
    Note, your tag name should not contain spaces!
  2. Give them the effects and item by targeting the player with the tag.
    /effect @a[tag=RandomSelection] fire_resistance
    /give @a[tag=RandomSelection] stone
    
  3. Remove the tag.
    /tag @a[tag=RandomSelection] remove RandomSelection
    

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.