This video will help you create player-join detection in just 5 command blocks, so you can detect when a player joins the game and so you can write commands to affect a player immediately when they join the world!
Yes, that's right! Unlike most methods, this method will allow you to detect WHO has joined your world and allow you to use commands specifically on the player who joined!
Remember to do
/gamerule commandblockoutput false
This method works on Bedrock, and may or may not work on Java. I haven't tried it on Java, so I wouldn't know.
----------
NOTE -
In case it isn't clear enough in the video, the system will NOT automatically remove you "justJoined" tag. This means that you will need to place a command block (not in the same command chain) which removes the tag.
In the examples, you can see there is always one command block, which affects the player, and then another command block after, which removes the "justJoined" tag, since we don't need it anymore.
----------
THE COMMANDS -
Player-join Detection -
/scoreboard players add @a join 1
/tag @a[scores={join=!2}] add justJoined
/scoreboard objectives remove join
/scoreboard objectives add join dummy
/scoreboard players add @a join 1
Example: Chat Message -
/execute @a[tag=justJoined] ~ ~ ~ me §djust joined the world!
/tag @a remove justJoined
Example: Particle Effect -
/execute @a[tag=justJoined] ~ ~ ~ particle minecraft:knockback_roar_particle ~ ~ ~
/tag @a remove justJoined
Example: Constant Spawn Point -
/tp @a[tag=justJoined] 0 -60 -10
/tag @a remove justJoined
----------
Discord: / discord
----------
Music -
Cartoon - On & On (feat. Daniel Levi) [NCS Release]
Supplied by NoCopyrightSounds
Link: • Cartoon, Jéja - On & On (feat. Daniel Levi...
----------
0:00 Intro
0:19 Tutorial
1:26 Example: Chat Message
2:33 Example: Particle Effect
2:50 Example: Constant Spawn Point
3:29 Outro