How do I detect if more than 2 player are online with command blocks minecraft 1.14.4

by Johannes173   Last Updated October 19, 2019 22:14 PM - source

Me and my friend wants to make a custom map and we need to detect if there's atleast 2 players online with command blocks.

Is there any way to do that?

Tags : minecraft

Answers 1

You can solve this problem using scoreboards. In an impulse command block put this command:

/scoreboard objectives add playercount dummy "playercounter"

Then connect 4 chain command blocks set to always active, in the first one put this command:

/execute as @a run scoreboard players add x playercount 1


/execute if score x playercount matches 2.. run *"your command here"*


/execute if score x playercount matches ..2 run tellraw @a {"text":"There are not enough players","color":"red"}


/scoreboard players reset x playercount
Bloodbeast 234
Bloodbeast 234
October 20, 2019 09:44 AM

Related Questions

How to make a map

Updated December 27, 2017 04:14 AM