How to use a command block to welcome new players on a server in Minecraft?

Solution 1:

if you have them spawn 3 blocks above a hidden command block (powered with a simple clock), you could have that command block do something along the lines of /testfor @p ~0 ~0 ~3 keep in mind that i'm not entirely certain if that's the specific thing to test for to check for players... then hook up a comparator from the first command block to a second one running the message command to @p ~0 ~3 ~3 or ~3 ~0 ~3 depending on which direction the comparator faces (and negative alterations would also be used as necessary)

Solution 2:

My best way to check first login independent on spawn position:

SIMPLE (one title):

  1. /scoreboard teams add notFirstLogin
  2. build simple clock f.e. 1 sec cyclus with block /testfor @a[team=]
  3. result from testfor comparator goes to the welcome message (/title @a[team=]
  4. after message put repeater with some delay and then command_block with: /scoreboard teams join notFirstLogin @a[team=]

logic of this proccess:

  • player without team is first time on the server
  • all players have some team except new guys
  • if you have more complicated welcome (more than one title @a[team=] title ...) is necessary put there some waiting values:

COMPLICATED (more titles)

  1. /scoreboard teams add notFirstLogin

    /scoreboard objectives add W8ing4Welcome dummy

    /scoreboard objectives add ShowWelcome dummy

  2. build simple clock f.e. 1 sec cyclus with two cmd_blocks:

  3. /scoreboard players set W8ing4Welcome @a[team=] 1

    3.x: ... others things that are necessary call at first login
    
    3.before_end: 
        small repeater delay 
    
    3.end:
        /scoreboard teams join notFirstLogin @a[team=]
    
  4. /testfor @a[score_W8ing4Welcome_min=1] ... here connect all welcomes in series:

    4.1. logical circuit AND within /testfor @a[score_ShowWelcome_min=1] 
    ... checking that here is NOBODY with ShowWelcome=1 ... this is important to prevent covering of messages
    4.2. /scoreboard playes set @a[score_W8ing4Welcome_min=1] ShowWelcome 1
    4.3.  small repeater delay
    4.4. /scoreboard playes set  @a[score_ShowWelcome_min=1] W8ing4Welcome 0
    4.5.  small repeater delay
    4.6. /title @a[score_ShowWelcome_min=1] title ...
    4.7.  small repeater delay
    4.8. /title @a[score_ShowWelcome_min=1] title ...
    4.x  ....
    4.end. /scoreboard playes set @a[score_ShowWelcome_min=1] ShowWelcome 0