In Java Edition, the follwing command works /execute store result score @p myScoreboard if entity @a Explanation Store the number of players in the nearest player's score score Of course, /execute in Bedrock Edition is still stuck in the "dark ages" of commands, only modifying the execution position and location, nothing else