---
title: Set Player Team
description: "Play 0x6D, server → client."
---

`play` · `0x6D` · **clientbound** (server → client)

Creates, removes, or updates a scoreboard team, or adds and removes members. The mode byte selects the action; team info includes display name, prefix, suffix, color, and flags for friendly fire, name tag and collision visibility. The client uses teams for name coloring, visibility and collision rules.

Sent by the server, read by the client. Listen for it with `client.on("SetPlayerTeam", (data) => …)` on the receiving side.

## Fields

| Field | Type | Notes |
|---|---|---|
| `team` | String |  |
| `mode` | Byte | Enum: `0` add, `1` remove, `2` change, `3` join, `4` leave. |
| `displayName` | NBT | Only when `mode` is `add` or `change`. |
| `prefix` | NBT | Only when `mode` is `add` or `change`. |
| `suffix` | NBT | Only when `mode` is `add` or `change`. |
| `nameTagVisibility` | VarInt | Only when `mode` is `add` or `change`. Enum: `0` always, `1` never, `2` hide_for_other_teams, `3` hide_for_own_team. |
| `collisionRule` | VarInt | Only when `mode` is `add` or `change`. Enum: `0` always, `1` never, `2` push_other_teams, `3` push_own_team. |
| `color` | Optional | Only when `mode` is `add` or `change`. |
| `flags` | UByte | Only when `mode` is `add` or `change`. |
| `players` | Struct |  |

## Send it

```ts
await client.sendPacket("SetPlayerTeam", {
  team: /* String */,
  mode: /* Byte */,
  displayName: /* NBT */,
  prefix: /* NBT */,
  suffix: /* NBT */,
  nameTagVisibility: /* VarInt */,
  collisionRule: /* VarInt */,
  color: /* Optional */,
  flags: /* UByte */,
  players: /* Struct */,
});
```

Field aliases listed under Notes are accepted as alternative keys when writing.

Source: [`src/Core/Versions/776/Packets/play/clientbound/SetPlayerTeam.ts`](https://github.com/GDLev/mc-protocol/blob/master/src/Core/Versions/776/Packets/play/clientbound/SetPlayerTeam.ts)
