iqled

make me a 1.21.11 paper plugin that upon a player sleeping in the bed, when its ment to show everyone a message that says 1/xx players is sleeping, remove that message completely

Kodari AI
KodariSep 24 at 1:42 pm 2
SilentSleep
SilentSleep is a lightweight Paper plugin for Minecraft 1.21.11 that completely removes the vanilla "player is sleeping" broadcast message. When a player enters a bed, the server normally announces how many players are sleeping (e.g., "1/5 players are sleeping"). This plugin intercepts and suppresses that message entirely, allowing players to sleep without any chat notification. The plugin hooks into the PlayerBedEnterEvent and cancels the broadcast while still allowing the sleep mechanic to function normally. It requires no configuration and works out of the box, providing a clean and quiet sleeping experience for all players on the server.
  1. Create the Paper 1.21.11 plugin scaffold.

  2. Clear the sleep-count action bar after a successful bed entry, without changing sleep or night-skipping mechanics.

Created the Paper 1.21.11 plugin. When a player successfully enters a bed, it clears the action bar for everyone, removing the sleeping-progress message without changing sleep behavior.

Note: this also clears any other action-bar message displayed at that moment.

iqled

the sleep progress action bar message still shows for a tiny bit, make it so it doesnt show completely

Kodari AI
KodariSep 24 at 1:54 pm 1

The action bar is now cleared immediately when bed entry succeeds, with a second clear on the next tick to catch any message sent afterward.

iqled

make it so the action bar never shows up in general

Kodari AI
KodariSep 24 at 2:01 pm 1
  1. Remove the bed-entry-only handler.

  2. Clear every online player’s action bar every tick, regardless of what triggered it.

Changed it to clear every online player’s action bar every tick, so action-bar messages won’t remain visible. This affects all action-bar content, including messages from other plugins, and may cause flickering if another plugin continuously sends them.

iqled

make it so it only affects the sleeping action bar content

Kodari AI
KodariSep 24 at 2:03 pm 2
  1. Replace the global action-bar wipe with outgoing-packet filtering.

  2. Cancel only the vanilla sleep-progress action-bar packet, leaving all other action bars untouched.

Sleep progress is now filtered from outgoing action-bar packets by its sleep.players_sleeping translation key, leaving other action-bar messages alone. ProtocolLib must be installed for the filter to work.

iqled

protocol lib is installed, so can you make it so the sleep display message that usually says x/x is sleeping just doesnt appear overall, only affecting the message when someone sleeps at night and no other message

Kodari AI
KodariOct 3 at 1:27 pm 1
  1. Match the sleep-progress translation key instead of relying on exact JSON formatting.

  2. Check both action-bar packet routes, while filtering only system-chat packets marked as action-bar overlays.

Updated the ProtocolLib filter to suppress only the sleep.players_sleeping message, whether it arrives as an action-bar packet or an action-bar system-chat overlay. Regular chat and other action-bar messages are left alone.

iqled

will i have to do anything related to protocol lib like config?

Kodari AI
KodariOct 3 at 1:28 pm 1

No ProtocolLib configuration is needed. Just make sure ProtocolLib is installed, enabled, and compatible with your server version, then restart the server so the plugin can register its packet filter. Other ProtocolLib settings can stay at their defaults.

iqled

how do i enable protocol lib?

Kodari AI
KodariOct 3 at 1:28 pm 1

ProtocolLib is enabled by installing it as a server plugin:

  1. Download a ProtocolLib build compatible with your Paper version from the official ProtocolLib GitHub releases.

  2. Stop the server and put the downloaded .jar in the server’s plugins folder.

  3. Start the server again—don’t use /reload.

  4. Check /plugins or the startup console to confirm ProtocolLib is enabled.

No extra ProtocolLib configuration is normally needed. If it shows as disabled or reports an error, check that the build supports your server version.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
4 72
src/main/java/com/kodari/sleepmessagesuppressor/SleepMessageSuppressor.java
package com.kodari.sleepmessagesuppressor;

import com.comphenix.protocol.PacketType;
import com.comphenix.protocol.ProtocolLibrary;
import com.comphenix.protocol.events.ListenerPriority;
import com.comphenix.protocol.events.PacketAdapter;
import com.comphenix.protocol.events.PacketEvent;
import com.comphenix.protocol.wrappers.WrappedChatComponent;
import org.bukkit.plugin.java.JavaPlugin;

public final class SleepMessageSuppressor extends JavaPlugin {
    @Override
    public void onEnable() {
        ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(
                this, ListenerPriority.NORMAL, PacketType.Play.Server.SET_ACTION_BAR_TEXT,
                PacketType.Play.Server.SYSTEM_CHAT) {
            @Override
            public void onPacketSending(PacketEvent event) {
                if (event.getPacketType() == PacketType.Play.Server.SYSTEM_CHAT
                        && !event.getPacket().getBooleans().read(0)) {
                    return;
                }

                WrappedChatComponent component = event.getPacket().getChatComponents().read(0);
                if (component != null && component.getJson().contains("sleep.players_sleeping")) {
                    event.setCancelled(true);
                }
            }
        });
    }

    @Override
    public void onDisable() {
        ProtocolLibrary.getProtocolManager().removePacketListeners(this);
    }
}