1
I need some help with the Teams command
So, on a realm. I'm running a command block clock that swaps players between a rainbow of teams, and I was wondering how would I exclude one specific player from that? Such as while everyone else is cycled through the rainbow, one specific player stays put in a black team.
Currently the command I'm using is: "/team join Red @a" this is copied into 7 command blocks, each one the same command but with a different color.
Currently the command I'm using is: "/team join Red @a" this is copied into 7 command blocks, each one the same command but with a different color.
Create an account or sign in to comment.
2
3
If you already know the name of the player you want to exclude, this is actually pretty easy.
The ! basically means Not. As such, we are searching for any player who isn't named Steve.
With that said, we can take this a step further. What if we want a player who pushes a button to be excluded from the team? Obviously there is no way to know the username to whoever pushed the button, so we will have to use a clever workaround.
We can simply tag whoever we want, and then target everyone else who doesn't have the tag. The tag can easily be removed by specifying remove instead of add.
Hope this helps! :)
~SUPERIONtheKnight
/team join Red @a[name=!Steve]
The ! basically means Not. As such, we are searching for any player who isn't named Steve.
With that said, we can take this a step further. What if we want a player who pushes a button to be excluded from the team? Obviously there is no way to know the username to whoever pushed the button, so we will have to use a clever workaround.
We can simply tag whoever we want, and then target everyone else who doesn't have the tag. The tag can easily be removed by specifying remove instead of add.
/tag @p add Example
/team join Red @a[tag=!Example]
/tag @p remove Example
Hope this helps! :)
~SUPERIONtheKnight
2
on top of this, if you use @r you can specify a random player to join a team, and through /execute you can prevent a player from swapping teams if they are already on one. so if you want a player on the black team, that is where they stay.
I am not 100% sure on the command structure but some tinkering and testing might work
Try something along the lines of /execute unless <unknown [Fill this in with a way to prevent them from swapping teams]>
I know that was very unspecific but it should work if you try at it for a bit.
Will test and get back to you
I am not 100% sure on the command structure but some tinkering and testing might work
Try something along the lines of /execute unless <unknown [Fill this in with a way to prevent them from swapping teams]>
I know that was very unspecific but it should work if you try at it for a bit.
Will test and get back to you