Minecraft – Targetting players with a specific score doesn’t seem to work

minecraft-commandsminecraft-java-edition

How can I target a player with a specific score? For example: Set the score of Score to 100 for every player with 1 Point in the scoreboard objective ScoreB. I tried

/scoreboard players add @a[score_Score_min=1] Score 1

and it actually worked. But then i set the score for a "player" named "Test" to 1 and it didn't get points. What did I do wrong?

Best Answer

It sounds like "Test" is not a real player.

The problem in this case is that target selectors like @a[...] can only resolve / find entities that exist somewhere in the world and are loaded.

This means that while you can change the scores of fake or offline players (scoreboard scores are stored in scoreboard.dat rather than playerdata) by specifying their name directly, i.e.

/scoreboard players set Rayset Score 29

You can not use target selectors unless there is an entity to resolve.

If an entity exists, your command is correct. @a[score_Score_min=1] resolves all player entities with a Score score of at least 1.