Minecraft – How to set new players into a team

minecraft-commandsminecraft-java-edition

I haven't played Minecraft for a while now, and I've forgotten an awful lot about commands blocks, redstone, and scoreboards as such. So I have two questions:

  1. If a new player joins the game, how can I set them into a team, and then give them 1 xp?

  2. If a player is in a team, and has 1 xp, how would I teleport them to a specific location?

Best Answer

1: If a new player joins, how can i set them into a team and give them, 1 xp?

Have the following commands running, in this order, on a clock:

/xp 1l @a[team=]
/scoreboard teams join <NewPlayerTeamName> @a[team=]

As you've said every player should be in a team, only newly joined players will have no team (team=). After receiving 1l, they'll be put onto <NewPlayerTeamName> (replace with an existing team).


2: If a player is in a team, and has 1 xp, how do i teleport them to a certain place?

/tp @a[team=<TeamName>,lm=1] X Y Z

The team= selector finds people on <TeamName> (replace with an existing team) with at least one EXP level.