I'm trying to make a command block that detects how many players are in a certain area. When there is a single player it runs the next line of command blocks(I am using 1.9 so I can use conditional command blocks and connect them). I have no clue how to do this.
The flaw with this is that it only works once but once they player get's out of that Area it's very easy to to reset it here is the Commands and setup:
/scoreboard objectives add [1] dummy
(The name doesn't have to be one its just for my example)
In the Chain command block to the left put: /scoreboard players set @a [1] 1
In the Middle chain command block: /scoreboard players add Area [1] 1 (The name Area can be changed aswell)
In the Left repeating command block: testfor @a[score_1_min=0,score_1=0] (you will need to enter your x, y, z same for xd, yd, zd)
Then you should be good to go if you don't know how to add in the x, y, z things Just ask me EDIT: make sure that the 2 chain command blocks are conditional! this only counts up but there is some easy setups you can do to make it work for example if some one dies just teleport them to a place and let this run but it will only work with the amaount of players you chose which can be easly fixed
Thankyou! I just found another way to do this too. I hooked up a redstone circuit to a testfor command block. {C > - - B r L) C = command block with testfor command, > = comparator, - = redstone dust, B = any block that can pass a redstone signal, r = redstone torch, L = line of commandblocks. I like this way better because it doesn't need to be reset and it makes more sense to me. Thankyou
I'm trying to make a command block that detects how many players are in a certain area. When there is a single player it runs the next line of command blocks(I am using 1.9 so I can use conditional command blocks and connect them). I have no clue how to do this.
IP to Connect: enatic.my.pebble.host
I have an idea on how to do this but i haven't fully tested it i will post it here if it works like you want it to
Creator of "Spawncube" Click here to go to forum thread! - THEGamingninja
My Youtube Channel: https://www.youtube.com/c/THEGamingninjaGamingPC Remember to Subscribe!
Thx for your reply, I am trying to make a minigame where the last player remaining wins but yet again I don't know how to do this.
IP to Connect: enatic.my.pebble.host
The flaw with this is that it only works once but once they player get's out of that Area it's very easy to to reset it here is the Commands and setup:
/scoreboard objectives add [1] dummy
(The name doesn't have to be one its just for my example)
In the Chain command block to the left put: /scoreboard players set @a [1] 1
In the Middle chain command block: /scoreboard players add Area [1] 1 (The name Area can be changed aswell)
In the Left repeating command block: testfor @a[score_1_min=0,score_1=0] (you will need to enter your x, y, z same for xd, yd, zd)
Then you should be good to go if you don't know how to add in the x, y, z things Just ask me EDIT: make sure that the 2 chain command blocks are conditional! this only counts up but there is some easy setups you can do to make it work for example if some one dies just teleport them to a place and let this run but it will only work with the amaount of players you chose which can be easly fixed
Creator of "Spawncube" Click here to go to forum thread! - THEGamingninja
My Youtube Channel: https://www.youtube.com/c/THEGamingninjaGamingPC Remember to Subscribe!
Thankyou! I just found another way to do this too. I hooked up a redstone circuit to a testfor command block. {C > - - B r L) C = command block with testfor command, > = comparator, - = redstone dust, B = any block that can pass a redstone signal, r = redstone torch, L = line of commandblocks. I like this way better because it doesn't need to be reset and it makes more sense to me. Thankyou
IP to Connect: enatic.my.pebble.host
No problem!
Creator of "Spawncube" Click here to go to forum thread! - THEGamingninja
My Youtube Channel: https://www.youtube.com/c/THEGamingninjaGamingPC Remember to Subscribe!