Minecraft wiki entry for scoreboard, associated text: Syntax
scoreboard players list [<target>] (Java Edition)
scoreboard players list [playername: target] (Bedrock Edition)
Description
Lists all score holders which are tracked in some way by the scoreboard system. The optional <target> or playername: target parameter is used to list the scores of particular score holders.
Arguments
JE: <target>: score_holder
BE: playername: target: WildcardCommandSelector<Actor>
Specifies the score holder(s).
Must be a selection of score holders. It may be either a target selector, a player name, a UUID‌[Java Edition only], a unique ID of an entity‌[Bedrock Edition only], or * for all score holders tracked by the scoreboard. Named player needn't be online, and it even needn't be a real player's name.
In Java Edition, only a single score holder can be specified, and * doesn't work (MC-136858). In Bedrock Edition, it can specify multiple score holders.
Result
Command Trigger Java Edition Bedrock Edition
... list [<target>] the arguments are not specified correctly Unparseable Failed
... list there's no score holder being tracked by the scoreboard system Successful
... list <targets> <targets> fails to resolve to a single score holder Failed N/A
... list [playername: target] playername: target fails to resolve to one or more score holders N/A Failed
... list <targets>
... list [playername: target] the specified score holder isn't tracked by any objectives Successful
any On success List the scores.
Output
Command Edition Situation Success Count /execute store success ... /execute store result ...
... list Java Edition On fail 0 0 0
On success 1 1 the number of score holders
Bedrock Edition On fail 0 N/A N/A
On success the number of score holders N/A N/A
... list <targets>
... list [playername: target] Java Edition On fail 0 0 0
On success 1 1 the number of tracking objectives of the specified score holder
Bedrock Edition On fail 0 N/A N/A
On success the total number of tracking objectives of each score holder N/A N/A