Updated:
1. Greet first-time players
# Repeat, Always Active
execute as @a[tag=!joined] run tellraw @a [{"selector":"@s","color":"yellow"},{"text":" joined for the first time!","color":"yellow"}]
# Chain, Always Active
tag @a[tag=!joined] add joined
The tag is added after the message, so it shows once per player (tag command). Add give @a[tag=!joined] … before the tag line to hand out a rule book too (written book command).
2. Detect returning players (Java)
scoreboard objectives add left minecraft.custom:minecraft.leave_game
# Repeat, Always Active
execute as @a[scores={left=1..}] run tellraw @s {"text":"Welcome back!","color":"aqua"}
# Chain, Always Active
scoreboard players reset @a[scores={left=1..}] left
leave_game goes up when a player leaves, so it is 1 or more when they come back. Show the message, then reset it.
3. Big title instead
execute as @a[scores={left=1..}] run title @s title {"text":"Welcome","color":"gold"}
See title and tellraw.
4. Send joiners to the lobby
execute as @a[scores={left=1..}] run tp @s 0 100 0
Place it before the reset block. See the lobby commands.
Troubleshooting
- Message repeats: check that the tag or reset block runs.
- No welcome back: leaves before the objective existed are not counted; rejoin once to test.
- Bedrock: the tag method works; rejoin detection is Java only.
Check your command
The Command Error Doctor checks common syntax mistakes in your browser.