HyperScript
Docs

← All of the Docs Players

Teams

effectadd <who> to team <name>since 1.5.7

Put a player in a team, leaving the one they were in

add player to team "red"
Try it
effectremove <who> from teamsince 1.5.7

Take a player out of their team

remove player from team
Try it
effectremove <who> from team <name>since 1.5.7

The same, but only if they are in that team

remove player from team "red"
Try it
effectset color of team <name> to <colour>since 1.5.7

The colour of names: red, dark_blue, gold, or a code such as "&a"

set color of team "red" to red
Try it
effectset prefix of team <name> to <text> / set suffix of team <name> to <text>since 1.5.7

Text before or after each name

set prefix of team "red" to "&c[Red] "
Try it
effectset friendly fire of team <name> to <true or false>since 1.5.7

Whether team mates can hurt each other

set friendly fire of team "red" to false
Try it
effectdelete team <name>since 1.5.7

Remove a team; its players are in no team afterwards

delete team "red"
Try it
expressionteam of <who>since 1.5.7

The name of a player's team; unset if they have none

if team of player is "red":
    send "&cGo red!"
Try it
expressionplayers of team <name>since 1.5.7

A list of the names in a team, online or not

for each {_mate} in players of team "red":
    send "&cRed team, assemble!" to {_mate}
Try it
Guide and examples

A team colours its players' names in chat, in the tab list and above their heads, and can put a tag in front of them.

on load:
    set color of team "red" to red
    set prefix of team "red" to "&c[Red] "
    set friendly fire of team "red" to false

command /red:
    trigger:
        add player to team "red"
        send "&cYou joined the red team."
SyntaxEffect
add <who> to team <name>Put a player in a team, leaving the one they were in
remove <who> from teamTake a player out of their team
remove <who> from team <name>The same, but only if they are in that team
set color of team <name> to <colour>The colour of names: red, dark_blue, gold, or a code such as "&a"
set prefix of team <name> to <text> / set suffix of team <name> to <text>Text before or after each name
set friendly fire of team <name> to <true or false>Whether team mates can hurt each other
delete team <name>Remove a team; its players are in no team afterwards
team of <who>The name of a player's team; unset if they have none
players of team <name>A list of the names in a team, online or not
  • A team is created the first time it is used. Names are up to 16 characters.
  • Teams are kept on the server's main scoreboard, so the server saves them and they survive restarts. Set them up in on load: so that they exist as soon as the script is loaded.
  • A player is in one team at a time.
  • Players who have a script sidebar see the same teams; HyperScript copies them onto each sidebar.
  • A team's colour is what changes the name above a player's head.