Only send join message on player's first join

This commit is contained in:
chatgptagent 2026-01-16 23:49:05 +00:00
parent a4e9f9cd5a
commit 3cce2c711c

View File

@ -58,7 +58,12 @@ public final class Main extends JavaPlugin implements Listener {
public void onJoin(PlayerJoinEvent event) { public void onJoin(PlayerJoinEvent event) {
Player player = event.getPlayer(); Player player = event.getPlayer();
event.setJoinMessage(ChatColor.GREEN + "" + ChatColor.BOLD + "[+] " + ChatColor.RESET + ChatColor.YELLOW + player.getName()); // event.setJoinMessage(ChatColor.GREEN + "" + ChatColor.BOLD + "[+] " + ChatColor.RESET + ChatColor.YELLOW + player.getName());
if (player.hasPlayedBefore()) {
event.setJoinMessage(null);
} else {
event.setJoinMessage(ChatColor.GREEN + "" + ChatColor.BOLD + "[+] " + ChatColor.RESET + ChatColor.YELLOW + player.getName());
}
setupPlayer(player); setupPlayer(player);
} }