Minecraft Commands – How to Use /tellraw to Output a Command

minecraft-commandsminecraft-java-edition

I want to /tellraw everyone the result of /team list teamA, which by itself would list the team members on teamA.

is there a way I can broadcast that to all players with a command block?

execute as @a at @s run team list blue

doesn't work, it only says the result in the command block's previous output bar

Using /say or /tellraw instead of /execute doesn't help either

There also isn't any NBT data with a player's team, or I am just unable to find it

I am fine if any type of command works as long as it says the /team list output in chat.

Best Answer

Have you yet tried this command?

/tellraw @a {"selector":"@a[team=teamA]"}

This command will list all the players on team teamA.