I was wondering how to make your own custom welcome messages in Minecraft using command blocks. I want it to replace the regular welcome message to make it look more professional. I am really looking forward to releasing my server in a couple of days so I want to make a good first impression. Thank you!
-
I have tried different websites and videos but they don't seem to work.– EtonDec 7, 2016 at 23:09
-
What version of server you have? I thought that vanilla MC has no welcome message? (X joined game is NOT welcome message) What is your welcome message now?– Antoine HejlíkDec 8, 2016 at 7:46
3 Answers
There is no way to alter the default welcome messages afaik. But you can add your own custom messages after that, using the title command or a custom tellraw message.
Returning player
To set this up, you'll first need a objective to detect when a player has left the game (run once):
# 1.12 and below
/scoreboard objectives add hasLeft stat.leaveGame
# 1.13 and above
/scoreboard objectives add hasLeft minecraft.custom:minecraft.leave_game
This will be on 1
as soon as they log back in. you can then use @a[score_hasLeft_min=1]
(1.12 and below) / @a[scores={hasLeft=1..}]
(1.13 and above) to target those players.
e.g.
# 1.12 and below
/title @a[score_hasLeft_min=1] title ["",{"text":"Welcome back!"}]
/execute @a[score_hasLeft_min=1] ~ ~ ~ /tellraw @a ["",{"text":"Welcome back "},{"selector":"@a[score_hasLeft_min=1]"},{"text":" to the server!"}]
# 1.13 and above
/title @a[scores={hasLeft=1..}] title ["",{"text":"Welcome back!"}]
/execute as @a[scores={hasLeft=1..}] run tellraw @a ["",{"text":"Welcome back "},{"selector":"@s"},{"text":" to the server!"}]
these commands will
- display "Welcome back!" as a title to the player that just logged in and
- display "Welcome back [player] to the server!" in chat, visible for everyone.
make sure to set the score to 0 after you displayed your messages to prevent the chat from being spammed:
# 1.12 and below
/scoreboard players set @a[score_hasLeft_min=1] hasLeft 0
# 1.13 and above
/scoreboard players set @a[scores={hasLeft=1..}] hasLeft 0
First time joining player
The Commands above will only provide a "welcome back" to players that came back for the second time. To target players that log in for the first time the easiest way would be something like this:
# 1.12 and below
/execute @a[tag=!firstJoin] ~ ~ ~ /tellraw @a ["",{"text":"A warm welcome to "},{"selector":"@a[tag=!firstJoin]"},{"text":" who joined for the first time!"}]
/scoreboard players tag @a[tag=!firstJoin] add firstJoin
# 1.13 and above
/execute as @a[tag=!firstJoin] run tellraw @a ["",{"text":"A warm welcome to "},{"selector":"@s"},{"text":" who joined for the first time!"}]
/tag @a[tag=!firstJoin] add firstJoin
Since players join for the first time, they won't have the firstJoin tag. you can execute the tellraw (or whatever) off of that, then add the tag to display the message only the very first time they join the server.
-
1For 1.13 and later: the command to create the objective is
scoreboard objectives add hasLeft minecraft.custom:minecraft.leave_game
and you'll need to replace@a[score_hasLeft_min=1]
with@a[scores={hasLeft=1..}]
. You also have to change the/execute
command toexecute as @a[scores={hasLeft=1..}] run <your command>
. Also note that you can use@s
to refer to what entity you're/execute
ing a command as.– bb94Jul 18, 2020 at 9:00
If I was you, then I would use a plugin. For example:
https://www.spigotmc.org/resources/welcomemessage.75514/
This plugin lets you customize the welcome message and you can even add colors!
If you are not opposed to using server- side resource packs, I believe you can replace the "joined game" with a custom message with a language pack.