2

I'm working on a map that has four teams red, Blue, Yellow, and Green. I have this command in a repeating command block /testfor @e[team=Yellow] I have one of each of these for each team. When a player dies they're still on the team, but when they die the command block comes out negative as if there were no players on that team until they respawn.

To simply say it. When a player dies the command block output is negative until they respawn, but I need it to be positive until they are off the team. And I can't have any other entities on the team or else it screws up my map. I don't believe there is any way to fix it unless I have an entity join the team when they die, and leave when they respawn. But there's no way I know of to do that.

I'm using MC 1.9-pre2

1

@a can detect dead players, so you use it instead of @e if all you want to detect is players:

/testfor @a[team=Yellow]
  • Thank you, but sorry for not mentioning this. I have entities on these teams. I'll try and work around it but what you said might work if I do both. I'll add one for @a and add another on for @e. – Pingyoping Feb 21 '16 at 17:32
0

Since @a can detect dead players, but you apparently also have entities on the team, I suggest you do the following:

/testfor @a[team=Yellow] /testfor @e[type=!Player,team=Yellow]

The result will be as you requested.

PS. Sorry for being a few years late. xP

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.