Skip to main content

Overview

Hubbly provides two commands for chat moderation: clearing chat history and locking/unlocking chat for non-privileged players.

/clearchat

Clears the chat for all online players by sending blank messages.

Syntax

/clearchat

Aliases

  • /cc
  • /clearc
  • /cchat

Permission

hubbly.command.clearchat
permission
Required to use the /clearchat command.Default: opDescription: Clears the chat

Behavior

  1. Verifies the sender has the required permission
  2. Sends 100 blank messages to every online player
  3. Effectively clears chat history from their screen
  4. Logs the action with the sender’s name to the debug log

Examples

/clearchat
/cc
This command sends blank messages to all players, regardless of their world or location. Players with chat logging plugins may still see the message history.

Technical Details

The command sends exactly 100 blank messages to ensure chat is fully cleared on most client configurations:
for(int i = 0; i <= CHAT_CLEAR_MESSAGE_COUNT; i++) {
    for(Player onlinePlayer : Bukkit.getOnlinePlayers()) {
        onlinePlayer.sendMessage("");
    }
}

/lockchat

Toggles chat lock status, preventing non-privileged players from sending messages.

Syntax

/lockchat

Aliases

  • /lc

Permission

hubbly.command.lockchat
permission
Required to use the /lockchat command and bypass the chat lock.Default: Not set (must be granted manually)

Behavior

  1. Checks if the sender has the required permission
  2. Toggles the global chat lock state
  3. Broadcasts a message to all players (except those in disabled worlds)
  4. Prevents non-privileged players from sending chat messages when locked

Examples

Locking chat:
/lockchat
Broadcast: Chat has been locked by <player_name> Unlocking chat:
/lockchat
Broadcast: Chat has been unlocked by <player_name>

Chat Lock Behavior

Locked State
state
When chat is locked:
  • Players without the bypass permission cannot send messages
  • Players with hubbly.bypass.chat or operator status can still send messages
  • Commands are not affected by chat lock
Unlocked State
state
When chat is unlocked:
  • All players can send messages normally

Disabled Worlds

The lock/unlock broadcast respects the disabled worlds configuration:
if(disabledWorlds.inDisabledWorld(p.getWorld())) {
    continue; // Skip players in disabled worlds
}
Players in disabled worlds will not see the lock/unlock broadcast message.

Messages

Messages are configurable in languages/en.yml:
chat_locked: Chat has been locked by %player_name%
chat_unlocked: Chat has been unlocked by %player_name%
Available Placeholders:
  • %player_name% - The name of the player who locked/unlocked chat
Unlike other messages, chat lock messages only support the %player_name% placeholder. PlaceholderAPI is not supported for these specific messages.

Permissions Summary

PermissionDescriptionDefault
hubbly.command.clearchatUse /clearchat commandop
hubbly.command.lockchatUse /lockchat command(not set)
hubbly.bypass.chatBypass chat lock restrictions(not set)
hubbly.command.*All command permissionsop

Source Reference

Implemented in:
  • ClearChatCommand.java:42 - Chat clearing handler
  • LockChatCommand.java:40 - Chat lock toggle handler
  • LockChat.java - Chat lock state manager

Build docs developers (and LLMs) love