I'm currently trying to make a scoreboard function that detects if the players score is 0. So far I have two scoreboards setup to make the lives counter work: a death counter which counts up when the player dies, and then a dummy objective which reverses the deathcount so it counts down. The dummy objective is titled "Lives" while the deathcount is called "Deaths" My main goal is to make the player go into spectator mode if the score is equal to zero. I would also like to know how to test for if everybody on a certain team has a score of 0. I tried setting up a hopper clock to this command: /testfor @a[score_Lives_min=0] and @a[score_Lives_dummy_min=0] but it does not work. I also tried to use this command: /testfor @a[score_Lives_min=0,team=team_red] If anyone can shed light on this problem, that would be well appreciated. Thanks.
The Meaning of Life, the Universe, and Everything.
Location:
Somewhere deep in code.
Join Date:
12/11/2011
Posts:
354
Location:
Earth
Minecraft:
OliverGriffin
Member Details
Okay so you have your deaths and lives scoreboards and I'm assuming that you are using also have the calculation of lives set up already but if you need help with that too just ask. The rest should be simple enough. Use /gamemode spectator @a[score_Lives=0, m=0] to change all players with 0 lives or less into spectator mode ONLY if they are in survival mode (meaning that it will only trigger once per player rather than repeatedly). 3 and sp can also be used rather than spectator. score_lives_min=0 looks at values of 0 and above which is probably why it didn't work for you before.
For the second problem, I propose a small circuit. In the attached circuit use the command /testfor @a[score_Lives_min=1,team=team_red] in the command block. This will only turn off the redstone torch when there are no players in team_red that have a Lives score greater than 0 remaining.
I hope this helped. Please feel free to ask me if you have anymore questions.
Thank you very much for your reply! I'm going to test your suggestion right now, but I have a quick question/clarification. You stated that "Use /gamemode spectator @a[score_Lives=0, m=0] to change all players with 0 lives or less into spectator mode ONLY if they are in survival mode" does this mean it won't work if a player is in Adventure Mode? If so, how can I fix it to turn them into spectator mode if they are in Adventure Mode. Again, thank you for your reply!
The Meaning of Life, the Universe, and Everything.
Location:
Somewhere deep in code.
Join Date:
12/11/2011
Posts:
354
Location:
Earth
Minecraft:
OliverGriffin
Member Details
I would use m=!3 but the not (!) never works on this specific parameter. I just assumed that you were in survival mode sorry, all you need to do to make it adventure is make m=2. Bear in mind that this one will ONLY work for adventure mode if you want both just have two command blocks one with m=0 and the other with m=2 as i don't think you can use the same parameter more than once. (P.s. thank me by clicking the up arrow for my reputation! jks i don't even care, I'm just gad to be able to help).
Thanks again for your second reply. It's no problem that you thought I was using survival, it's my fault for not stating I was using adventure. I tried both methods you suggested and they work! Thank you so much for your help!
Hi,
I'm currently trying to make a scoreboard function that detects if the players score is 0. So far I have two scoreboards setup to make the lives counter work: a death counter which counts up when the player dies, and then a dummy objective which reverses the deathcount so it counts down. The dummy objective is titled "Lives" while the deathcount is called "Deaths" My main goal is to make the player go into spectator mode if the score is equal to zero. I would also like to know how to test for if everybody on a certain team has a score of 0. I tried setting up a hopper clock to this command: /testfor @a[score_Lives_min=0] and @a[score_Lives_dummy_min=0] but it does not work. I also tried to use this command: /testfor @a[score_Lives_min=0,team=team_red] If anyone can shed light on this problem, that would be well appreciated. Thanks.
Okay so you have your deaths and lives scoreboards and I'm assuming that you are using also have the calculation of lives set up already but if you need help with that too just ask. The rest should be simple enough. Use /gamemode spectator @a[score_Lives=0, m=0] to change all players with 0 lives or less into spectator mode ONLY if they are in survival mode (meaning that it will only trigger once per player rather than repeatedly). 3 and sp can also be used rather than spectator. score_lives_min=0 looks at values of 0 and above which is probably why it didn't work for you before.
For the second problem, I propose a small circuit. In the attached circuit use the command /testfor @a[score_Lives_min=1,team=team_red] in the command block. This will only turn off the redstone torch when there are no players in team_red that have a Lives score greater than 0 remaining.
I hope this helped. Please feel free to ask me if you have anymore questions.
Did I help? +1 my reputation!
Tool for copying and pasting commands in bulk - http://www.minecraftforum.net/forums/minecraft-discussion/redstone-discussion-and/command-blocks/2417077-tool-for-copy-pasting-similar-commands-in-bulk
Thank you very much for your reply! I'm going to test your suggestion right now, but I have a quick question/clarification. You stated that "Use /gamemode spectator @a[score_Lives=0, m=0] to change all players with 0 lives or less into spectator mode ONLY if they are in survival mode" does this mean it won't work if a player is in Adventure Mode? If so, how can I fix it to turn them into spectator mode if they are in Adventure Mode. Again, thank you for your reply!
I would use m=!3 but the not (!) never works on this specific parameter. I just assumed that you were in survival mode sorry, all you need to do to make it adventure is make m=2. Bear in mind that this one will ONLY work for adventure mode if you want both just have two command blocks one with m=0 and the other with m=2 as i don't think you can use the same parameter more than once. (P.s. thank me by clicking the up arrow for my reputation! jks i don't even care, I'm just gad to be able to help).
Did I help? +1 my reputation!
Tool for copying and pasting commands in bulk - http://www.minecraftforum.net/forums/minecraft-discussion/redstone-discussion-and/command-blocks/2417077-tool-for-copy-pasting-similar-commands-in-bulk
Thanks again for your second reply. It's no problem that you thought I was using survival, it's my fault for not stating I was using adventure. I tried both methods you suggested and they work! Thank you so much for your help!
No problem, that's what the forum is for!
Did I help? +1 my reputation!
Tool for copying and pasting commands in bulk - http://www.minecraftforum.net/forums/minecraft-discussion/redstone-discussion-and/command-blocks/2417077-tool-for-copy-pasting-similar-commands-in-bulk