forum Forumsplay_arrow Minecraft fiber_manual_record Redstone


I need some help with the Teams command

0 emerald • 2 replies90 views
created 10/08/2018 1:06 pm by BaronOfOblivion
last reply 10/21/2018 8:25 pm
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 avatar
Level 1 : New Miner

2 replies

10/09/2018 1:49 am
Level 8 Apprentice Engineer
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! :)
10/21/2018 8:25 pm
Level 6 Apprentice Mage
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




© 2010 - 2018