remmbu.

Make a plugin for 1.21.11 Purpur that mutes/deletes this automatic broadcast from the server itself that I cannot get rid of.

1 image attached
Kodari AI
KodariOct 7 at 2:57 am 1
BroadcastSilencer
BroadcastSilencer is a lightweight Purpur 1.21.11 plugin that intercepts and suppresses unwanted automatic server broadcasts. It hooks into the server's chat and console messaging pipeline to detect specific broadcast patterns or keywords, then either completely deletes the message or replaces it with a muted placeholder. The plugin features a configurable keyword list, toggleable mute/delete modes, and a permission-based command system allowing admins to add or remove filtered phrases in real-time without restarting. It also logs suppressed broadcasts for auditing purposes, ensuring server operators maintain full control over their chat environment while eliminating persistent automated messages that cannot be removed through standard server configuration.

I’ll add a Paper-compatible plugin that cancels server broadcasts containing the hosting message, with the match phrase configurable.

Created BroadcastFilter. It cancels server broadcasts containing “Hosted by MCServerHost.com”; edit blocked-message-fragments in config.yml to change the match.

This filters messages sent through Paper’s broadcast event. If the host injects the message directly into player connections, this event won’t catch it.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
5 73
src/main/java/com/kodari/broadcastfilter/BroadcastFilterPlugin.java
package com.kodari.broadcastfilter;

import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.server.BroadcastMessageEvent;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.List;
import java.util.Locale;
import java.util.regex.Pattern;

public final class BroadcastFilterPlugin extends JavaPlugin implements Listener {
    private static final Pattern FORMATTING_CODES = Pattern.compile("(?i)[§&][0-9A-FK-ORX]");
    private volatile List<String> blockedFragments;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        blockedFragments = getConfig().getStringList("blocked-message-fragments").stream()
                .map(BroadcastFilterPlugin::normalize)
                .filter(fragment -> !fragment.isBlank())
                .toList();
        getServer().getPluginManager().registerEvents(this, this);
    }

    @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
    public void onBroadcast(BroadcastMessageEvent event) {
        String message = normalize(PlainTextComponentSerializer.plainText().serialize(event.message()));
        for (String fragment : blockedFragments) {
            if (message.contains(fragment)) {
                event.setCancelled(true);
                return;
            }
        }
    }

    private static String normalize(String text) {
        return FORMATTING_CODES.matcher(text).replaceAll("").toLowerCase(Locale.ROOT);
    }
}