Minecraft – Why won’t a command block detect a score

minecraft-commandsminecraft-java-edition

I am trying to have a command block test for a score of 5 on a non-existent player name with a dummy objective. However, the command block is not detecting any score on the dummy, but when i do the command as a player, it executes perfectly. Note that when looking at the command, the non-existent name is @[type=armor_stand,r=10]. Do not mistake that for anything else. I messed up on a scoreboard command and named it that.

/scoreboard players test @[r=10,type=armor_stand] code 5 5

Best Answer

The problem is your player name. I recreated the entire setup with your nonexistent player name and it fails to detect a score. (Even though it says it succeeded at setting a score). When I then attempted your same command on a nonexistent player named Tester it succeeds.

Here is the command I used to set score:

/scoreboard players set Tester code 5

Change your 'messed up' scoreboard command. Certainly easier then trying to find a work around solution.

I would recommend using only letters, numbers, and underscores in nonexistent player names.