一个简单的 Minecraft 客户端模组,用于撤销在 1.19.1-rc1 中引入的 run_command 点击事件限制,
从而允许再次通过 run_command 点击事件自由地将非命令消息作为聊天消息发送
如果你想要一种无需用户感知的解决方案,这里有一个仅服务端的模组,它实现了相同的功能: LetMeClickAndSendForServer
| Mod | Side | Advantage | Disadvantage |
|---|---|---|---|
| LetMeClickAndSend | client | 行为与 mc1.19.1 之前完全一致 | 需要所有玩家的客户端都安装 |
| LetMeClickAndSendForServer | server | 无需在客户端安装 | 最大聊天消息长度减少 7 |
示例
让我们运行以下命令,然后点击显示的文本
# Minecraft [1.7, 1.21.5)
/tellraw @a {"text":"click me to send \"hi\"","clickEvent":{"action":"run_command","value":"hi"}}
在原版 1.19.1 ~ 1.21.4 中,点击后你无法说话,因为 hi 不是一个有效的命令(不以 / 开头)
使用此模组后,点击后你将自动向服务器发送一条 hi 的聊天消息,这与之前的 Minecraft 版本中的行为相同
MC 1.21.5+
自 MC 1.21.5 起,run_command 的行为发生了很大变化
首先是命令语法的改变,影响不大:
# Minecraft [1.21.5, ~)
/tellraw @a {"text":"click me to send \"hi\"","click_event":{"action":"run_command","command":"hi"}}
接下来是行为的改变,影响较大:
- 无论
command值是否以/开头,它始终被视为有效 - 客户端会从
command值中剥离/前缀,并将剩余字符串作为命令发送
现在已无法正确区分“用于发送聊天消息的 run_command”和“用于发送命令的 run_command”
作为一种变通方法,适用于 MC >= 1.21.5 的 LetMeClickAndSend 将仅允许某些命令绕过原版检查,并始终支持点击即发送。
默认情况下,只有以 !! 开头的 command 值才允许这样做,这是 MCDReforged 插件生态系统中常用的命令前缀
添加了一个位于 ./config/letmeclickandsend/config.json 的配置文件,用于自定义绕过行为
{
"sendChatPattern": "!!.*"
}
sendChatPattern 应为一个有效的正则表达式模式。所有完全匹配该模式的 command 值都将作为聊天消息发送
要测试默认配置,你可以使用:
/tellraw @a {"text":"click me to send \"!!MCDR\"","click_event":{"action":"run_command","command":"!!MCDR"}}
依赖要求
这是一个仅客户端的模组。它不需要任何额外的依赖项
需求:
- Minecraft >= 1.19.1
A simple Minecraft client-side mod, that reverts the run_command click event restriction introduced in 1.19.1-rc1,
so non-command messages can be sent freely as a chat message via run_command click event again
If you want a solution without user awareness, here's a server-side only mod that does the same thing: LetMeClickAndSendForServer
| Mod | Side | Advantage | Disadvantage |
|---|---|---|---|
| LetMeClickAndSend | client | Exactly the same behavior as pre mc1.19.1 | Needs to be installed on all players' clients |
| LetMeClickAndSendForServer | server | No need to install on client | Reduces maximum chat message length by 7 |
Example
Let's run the following command, and then click the shown text
# Minecraft [1.7, 1.21.5)
/tellraw @a {"text":"click me to send \"hi\"","clickEvent":{"action":"run_command","value":"hi"}}
In vanilla 1.19.1 ~ 1.21.4, after clicking, you are not able to say anything since hi is not a valid command (not starts with /)
With this mod, after clicking, you will automatically send a hi chat message to the server, which is the same behavior as the previous Minecraft versions
MC 1.21.5+
Since MC 1.21.5, the run_command behavior has changed a lot
First is the change in command syntax, which has little impact:
# Minecraft [1.21.5, ~)
/tellraw @a {"text":"click me to send \"hi\"","click_event":{"action":"run_command","command":"hi"}}
Next is the change in behavior, which has a greater impact:
- The
commandvalue is always valid, regardless of whether it starts with a/or not - The client will strip the
/prefix from thecommandvalue and send the remaining string as a command
It's no longer possible to correctly distinguish between "a run_command for sending chat message" and "a run_command for sending command"
As a workaround, LetMeClickAndSend for MC >= 1.21.5 will only allow certain commands to bypass the vanilla check and always be click-and-send-able.
By default, only command value starting with !!, which is a commonly-used command prefix
in MCDReforged plugin ecosystem, will be allowed
A config file located at ./config/letmeclickandsend/config.json is added for customizing the bypass behavior
{
"sendChatPattern": "!!.*"
}
The sendChatPattern should be a valid regex pattern. All command values that fully match the pattern will be as chat messages
To test with the default configuration, you can use:
/tellraw @a {"text":"click me to send \"!!MCDR\"","click_event":{"action":"run_command","command":"!!MCDR"}}
Requirements
It's a client-side only mod. It requires 0 extra dependency
Requirements:
- Minecraft >= 1.19.1
下载 Let Me Click And Send
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Let Me Click And Send
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Let Me Click And Send
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Let Me Click And Send
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Let Me Click And Send
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Let Me Click And Send
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Let Me Click And Send
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Let Me Click And Send
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Let Me Click And Send
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Let Me Click And Send
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
- MC 26.2 && MC 26.3
构建信息
- 文件名:
LetMeClickAndSend-v1.2.3-mc1.21.5-neoforge.jar - SHA-256:
327df1965d7c668941faa513734598a4d16522b1d74c5a1b4f181e4fee18acec - 构建来源:
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
查看物品与配方
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
AE2:一款流行的自动化与存储模组
模组
那是什么?一个 Waila/Hwyla 的分支。
评论 0
登录后参与评分
还没有评论,来抢沙发吧