How to code a welcome message in minecraft 1.14? [duplicate]

Solution 1:

the way you're looking for that involved testfor and stat.leavegame would now be best suited by using execute and minecraft.custom:minecraft.leave_game. essentially, you would do all the same things you would with testfor, except no redstone is needed now. when you use execute, you can tell the game to run it if they have a leave game score of 0 (or whatever you need to do for it) by doing something like below;

/execute at @a as @s if score @s <scoreName> matches 0 run <command>

you could also do a different one, with this technique, for a command you want to run if their leave game score is a certain about (or higher than a certain amount);

/execute at @a as @s if score @s <scoreName> matches <value> run <command>

for <value>, to make it run for everything up to that value or everything that value and greater, use ..<value> or <value>.., respectively.