bookssmp

make a mod that auto says welcome back when a player joins the game

Kodari AI
KodariTue at 2:23 am 2
WelcomeBackAnnouncer
A Minecraft Fabric mod that automatically sends a personalized "Welcome back" message to players when they join the server. The mod hooks into the player join event and displays a configurable greeting in the chat, including the player's name. It supports customizable message templates and can be toggled on or off via configuration. The mod is lightweight, client-side compatible, and works seamlessly with existing server setups without requiring additional dependencies.
  • Broadcast a welcome message when a player joins.

  • Add the Fabric project configuration for Minecraft 26.2.

Created a server-side welcome mod that broadcasts “Welcome back, [player]!” whenever a player joins, including their first join.

bookssmp

can you make it so it is always active and only client side

Kodari AI
KodariTue at 2:42 am 2
  • Run the mod only on the client, with no toggle.

  • Send a chat welcome for players who join after your initial player list loads.

The mod is now client-side and always active. It sends “Welcome back, [player]!” in chat when another player joins; the server doesn’t need the mod.

bookssmp

can you make is so it says it once per one single person

Kodari AI
KodariTue at 2:56 am 1
  • Remember each player for the current server session.

  • Welcome them only the first time they join during that session.

Each player is now welcomed only once per server session, even if they leave and rejoin. The count resets when you reconnect.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
5 126
src/client/java/com/kodari/welcomeback/WelcomeBackClient.java
package com.kodari.welcomeback;

import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.minecraft.client.multiplayer.ClientPacketListener;

public class WelcomeBackClient implements ClientModInitializer {
    private ClientPacketListener connection;
    private final Set<UUID> knownPlayers = new HashSet<>();
    private boolean initialized;

    @Override
    public void onInitializeClient() {
        ClientTickEvents.END_CLIENT_TICK.register(client -> {
            ClientPacketListener current = client.getConnection();
            if (current != connection) {
                connection = current;
                knownPlayers.clear();
                initialized = false;
            }
            if (current == null) {
                return;
            }

            Set<UUID> online = new HashSet<>();
            current.getOnlinePlayers().forEach(info -> online.add(info.getProfile().id()));
            if (!initialized) {
                if (online.stream().noneMatch(client::isLocalPlayer)) {
                    return;
                }
                knownPlayers.addAll(online);
                initialized = true;
                return;
            }

            current.getOnlinePlayers().forEach(info -> {
                UUID id = info.getProfile().id();
                if (!knownPlayers.contains(id) && !client.isLocalPlayer(id)) {
                    current.sendChat("Welcome back, " + info.getProfile().name() + "!");
                }
            });
            knownPlayers.addAll(online);
        });
    }
}