Minecraft – Title Problems with multiplayer

minecraft-commandsminecraft-java-editionminecraft-java-edition-server

Ok, so as of right now, I am currently making a minigame related to racing. So, I have a title timer. It displays the time you take throughout the course. It works flawlessly, however, whenever I start a LAN server and someone comes on, the title timer refuses to work? The confusing part is the timer actually works in the background, it just doesn't display the title. When I go to the command block that does the title, its feedback says:

'That entity cannot be found'

Here is the command for reference:

/title @a[score_Playing_min=1,score_Playing=1] title ["",{"score":{"name":"@a[score_timing_min=1,score_timing=1]","objective":"dispminute"},"color":"blue"},{"text":":","color":"blue"},{"score":{"name":"@a[score_timing_min=1,score_timing=1]","objective":"dispsecond"},"color":"blue"}]

The 'Playing' objective is just an objective to see if someone is playing the game. The timing objective is seeing if someone wants to be timed. 1=YES, 0=NO. Dispminute and Dispsecond are just objectives to display the times. So, what's wrong?

Best Answer

The score tag requires the name selector to resolve to 1 target. If there are multiple players with a "timing" score of 1, then the command will fail.

You can force selection to be 1 player by adding c=1 to the selectors:

/title @a[score_Playing_min=1,score_Playing=1] title ["",{"score":{"name":"@a[score_timing_min=1,score_timing=1,c=1]","objective":"dispminute"},"color":"blue"},{"text":":","color":"blue"},{"score":{"name":"@a[score_timing_min=1,score_timing=1,c=1]","objective":"dispsecond"},"color":"blue"}]