1

I need some help with the Teams command

BaronOfOblivion's Avatar BaronOfOblivion10/8/18 1:06 pm history
1 emeralds 249 2
10/21/2018 8:25 pm
AstaZora's Avatar AstaZora
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.
Posted by BaronOfOblivion's Avatar
BaronOfOblivion
Level 1 : New Explorer
4

Create an account or sign in to comment.

2

3
10/09/2018 1:49 am
Level 29 : Expert Engineer
SUPERIONtheKnight
SUPERIONtheKnight's Avatar
If you already know the name of the player you want to exclude, this is actually pretty easy.
/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
10/21/2018 8:25 pm
Level 16 : Journeyman Engineer
AstaZora
AstaZora's Avatar
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
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome