In addition to specific players, one can also use target selectors for the <player> argument. These selectors include:
- @p – The nearest player
- @r – A random player
- @a – All players
- @e – All entities
- @s – The entity who executed the command (yourself)
Also Read
Using these designators, players can even create things like experience vendors by placing the XP command into a command block that targets those who interact with it.
There are also many other applications by using this command in cohesion with others across multiple command blocks, and players are encouraged to experiment.
Edited by Sijo Samuel Paul