Testing for a player with a certain score finds any player no matter what their score is

//ads -- adsterra.com -- native banner
?>
I have an objective called ninja, which can either have a score of 1 or 0. The command I am attempting to use is
/testfor @p[score_ninja=1]
However, the command returns "Found (my username)" rather than
"(My username) did not match the required data structure" when ninja
has a value of 0 or 1, but not if it is higher than 1.
Am I using the command wrong? Thank you in advance.
Pictures about "Testing for a player with a certain score finds any player no matter what their score is"



How do you test scoreboard?
The correct syntax for score selectors is /testfor (player)[scores={objective=number}] . However that command only selects one number. To select a minimum number you need to use a scoreboard test.How do you use an execute score?
The selector \u201c@p\u201d selects the nearest player. Alternatively, you could also use your Minecraft username, but if you run a command from the console you will always be the nearest player. The other target selectors are \u201c@a\u201d for all players, \u201c@r\u201d for a random player, and \u201c@e\u201d will target all entities.What does @P mean in Minecraft?
Target selectors are used in commands to select players and entities arbitrarily, without needing to specify an exact player name or a UUID. One or more entities can be selected with a target selector variable, and targets can be filtered from the selection based on certain criteria using the target selector arguments.FIFA 22 How to Find Your Lost Players Ultimate Team
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Pixabay, RF._.studio, RF._.studio, Darya Sannikova