ClickCopyChat 使聊天行可点击,玩家因此可以将文本复制到剪贴板,而无需重新输入。玩家聊天功能独立运行。当安装 ProtocolLib 时,插件和系统消息也支持复制。
工作原理
玩家聊天通过包装渲染后的 Adventure 组件来处理,此过程无需额外依赖。
插件和系统消息则经由 ProtocolLib 处理。该插件拦截服务器到客户端的聊天数据包(SYSTEM_CHAT、DISGUISED_CHAT、CHAT)并装饰其负载内容,无论其是 Adventure 组件、WrappedChatComponent 还是原始 JSON,随后将其写回。若数据包无法就地修改,则会取消原数据包并发送一个装饰后的副本,从而避免重复的行内容和动作栏覆盖。
功能特性
- 支持点击复制玩家聊天以及大多数插件消息(如 Essentials、Skript 广播和 LuckPerms 回复)
- 子组件也会被装饰,因此整行文本会被复制,而非仅部分文本
- 保留现有格式,并添加悬停提示
- 即使未安装 ProtocolLib,插件仍可正常加载,且玩家聊天依然可复制
命令
/cccdebug 切换调试日志记录
/cccpackets 列出当前已挂钩的聊天数据包类型
这两个命令均需权限 clickcopychat.debug,默认仅对操作员开放。
限制
- 复制到剪贴板是 Java 版客户端的功能,因此通过 Geyser 或 Floodgate 连接的基岩版玩家无法使用复制功能。
- 标题、副标题、动作栏和 Boss 栏不属于聊天内容,因此不受支持。
要求
- Paper 1.21.x
- Java 21 或更高版本
- ProtocolLib 为可选依赖。未安装时,仅玩家聊天可复制。
ClickCopyChat makes chat lines clickable, so players can copy the text to their clipboard instead of retyping it. Player chat works on its own. Plugin and system messages are covered too when ProtocolLib is installed.
How it works
Player chat is handled by wrapping the rendered Adventure component, which needs no extra dependency.
Plugin and system messages go through ProtocolLib. The plugin intercepts the server-to-client chat packets (SYSTEM_CHAT, DISGUISED_CHAT, CHAT) and decorates the payload, whether that is an Adventure component, a WrappedChatComponent, or raw JSON, then writes it back. Where a packet cannot be changed in place, it is cancelled and a decorated copy is sent instead, which avoids duplicated lines and action bar overlays.
Features
- Click to copy on player chat, and on most plugin messages such as Essentials, Skript broadcasts and LuckPerms replies
- Child components are decorated as well, so the whole line copies rather than part of it
- Existing formatting is preserved and a hover hint is added
- Without ProtocolLib the plugin still loads, and player chat stays copyable
Commands
/cccdebug toggles debug logging
/cccpackets lists the chat packet types currently hooked
Both require clickcopychat.debug, which defaults to operators.
Limitations
- Copy to clipboard is a Java Edition client feature, so Bedrock players connecting through Geyser or Floodgate cannot copy.
- Titles, subtitles, the action bar and boss bars are not chat, so they are not covered.
Requirements
- Paper 1.21.x
- Java 21 or newer
- ProtocolLib is optional. Without it, only player chat is copyable.
评论 0
登录后参与评分
还没有评论,来抢沙发吧