I have an orange team and a red team, and I'm using nonexistent players called "Orange" and "Red" to track the scores of the two teams. I have an objective called "Score" and each time a team scores I add one to that objective for the team's NE player.
A team wins when they get to five, so I'm trying to test for that using a command block and comparator. Problem is, it doesn't seem to be working. I've tried two things. First, I tried the /testfor command...
testfor Orange[score_Score=5,score_Score_min=5]
That didn't work, so I tried /say...
say Team @a[score_Score=5,score_Score_min=5] wins!
The latter works when I use my own name, but not when I use the NE player. I could be wrong, but I thought
these commands worked for NE players.
Am I doing something wrong? Or does this not work, and is there another way to do it?
You cannot test for players who aren't online. Easiest way around it is a hidden variable that is given all players--this will make sure you never have to specify a player who is online. I used one for my days of the week counter
I feel like there must be an easier way to do this, though. Can't you just name the teams Orange and Red and display that?
Just tested it out, and it looks like you can't. Dang it.
Okay, this will vary a lot depending on your game type, but here's the general idea:
If someone just has to hit a button in the opposing team's base, you could easily just do /scoreboard players add Orange displayPoints 1 (assuming Orange is one of your fake players on the display) and at the same time do /scoreboard players add @a[team=orange] realPoints 1. Then you use /testfor @a[team=orange,realPoints=5].
If someone just has to hit a button in the opposing team's base, you could easily just do /scoreboard players add Orange displayPoints 1 (assuming Orange is one of your fake players on the display) and at the same time do /scoreboard players add @a[team=orange] realPoints 1. Then you use /testfor @a[team=orange,realPoints=5].
I have an orange team and a red team, and I'm using nonexistent players called "Orange" and "Red" to track the scores of the two teams. I have an objective called "Score" and each time a team scores I add one to that objective for the team's NE player.
A team wins when they get to five, so I'm trying to test for that using a command block and comparator. Problem is, it doesn't seem to be working. I've tried two things. First, I tried the /testfor command...
That didn't work, so I tried /say...
The latter works when I use my own name, but not when I use the NE player. I could be wrong, but I thought
these commands worked for NE players.
Am I doing something wrong? Or does this not work, and is there another way to do it?
I feel like there must be an easier way to do this, though. Can't you just name the teams Orange and Red and display that?
mangled zombie corpsesunusual resources.Okay, this will vary a lot depending on your game type, but here's the general idea:
If someone just has to hit a button in the opposing team's base, you could easily just do /scoreboard players add Orange displayPoints 1 (assuming Orange is one of your fake players on the display) and at the same time do /scoreboard players add @a[team=orange] realPoints 1. Then you use /testfor @a[team=orange,realPoints=5].
mangled zombie corpsesunusual resources.That worked. Thanks.