How do I display a message onscreen whenever someone logs into my Minecraft server?
-
I am new to running a server with Apex hosting. I want to display a simple message at the center of the screen whenever someone logs into the server. How do I do this?
I would like a solution for both Java and Bedrock.
-
Java Edition:
First create a scoreboard to track new players:
scoreboard objectives add LeaveGame custom:leave_game
Then check in a ticking function if someone has not a score of 0 and if yes, display a title (a message in the middle of the screen) with the player name to them:
execute as @a unless score @s LeaveGame matches 0 run title @a title [{"selector":"@s"},{"text":" logged in"}] scoreboard players set @a LeaveGame 0
Bedrock Edition
I never played Bedrock Edition, but according to the https://minecraft.fandom.com/wiki/Commands/scoreboard#add scoreboards can only use the
dummy
criterion, which makes the concept above impossible. If it's enough that the title only appears once, when a new player joins, you can use a tag:execute @a[tag=!Tagged] ~ ~ ~ title @a title [{"selector":"@s"},{"text":" logged in"}] tag @a[tag=!Tagged] add Tagged
Not tested, please correct me if I'm wrong.