SimpleChat
暂时停止支持
一个适用于你服务器的简单聊天模组。
❗当前支持的模组版本为: ❗
在单人游戏中也能正常运行。

需要 Fabric API!
❗版本 1.17 需要 Java 16 才能运行❗
功能
- 全局聊天和本地聊天(可关闭)
- 彩色聊天(可关闭)
- 使用命令重载配置
- 面向开发者:玩家聊天事件
配置
配置文件位于 <游戏或服务器目录>/config/simplechat.json。
| 名称 |
描述 |
类型 |
| enable_chat_mod |
启用(true)或禁用(false)模组对聊天的处理。 |
boolean |
| enable_global_chat |
启用(true)或禁用(false)全局聊天功能。 |
boolean |
| enable_chat_colors |
启用(true)或禁用(false)在聊天中使用颜色代码。 |
boolean |
| local_chat_format |
定义本地聊天的显示样式。 |
String |
| global_chat_format |
定义全局聊天的显示样式。 |
String |
| chat_range |
指定本地聊天消息不可见的距离阈值(如果启用了全局聊天)。 |
int |
{
"enable_chat_mod": true,
"enable_global_chat": false,
"enable_chat_colors": false,
"local_chat_format": "%player% > &7%message%",
"global_chat_format": "&8[&bG&8] &r%player% > &e%message%",
"chat_range": 100
}
你可以使用占位符 %player% 来指定玩家的昵称,使用占位符 %message% 来指定玩家在聊天中发送的消息内容。
你可以使用 /simplechat 命令重载配置,而无需重启服务器或游戏(需要 权限等级 1 或更高)。
API
如果你是开发者,可以使用一个在玩家向聊天发送消息时触发的事件。
查看 me.vetustus.server.simplechat.api.event.PlayerChatCallback。
要控制行为,请使用 ChatMessage 子类,它可以用于取消发送消息或修改消息内容。
示例:
/**
* 通过取消事件来禁止玩家发送消息。
*/
PlayerChatCallback.EVENT.register((player, message) -> {
PlayerChatCallback.ChatMessage chatMessage = new PlayerChatCallback.ChatMessage(player, message);
chatMessage.setCancelled(true);
return chatMessage;
});
许可证
本项目采用 MIT 许可证。
SimpleChat
Temporary stop of support
A simple chat mod for your server.
❗The current supported version of the mod is: ❗
Works even in a single player game.

Requires the Fabric API!
❗Version 1.17 requires Java 16 to work❗
Features
- Global and local chat (you can turn it off)
- Color chat (you can turn it off)
- Reloading the configuration with the command
- For developers: Player chat event
Configuration
The configuration is located in <game or server directory>/config/simplechat.json.
| Name |
Description |
Type |
| enable_chat_mod |
Enables (true) or disables (false) chat handling by the mod. |
boolean |
| enable_global_chat |
Enables (true) or disables (false) the global chat. |
boolean |
| enable_chat_colors |
Enables (true) or disables (false) the use of color codes in the chat. |
boolean |
| local_chat_format |
Defines the appearance of the local chat. |
String |
| global_chat_format |
Defines the appearance of the global chat. |
String |
| chat_range |
Specifies the distance after which local chat messages will not be visible (if global chat is enabled). |
int |
{
"enable_chat_mod": true,
"enable_global_chat": false,
"enable_chat_colors": false,
"local_chat_format": "%player% > &7%message%",
"global_chat_format": "&8[&bG&8] &r%player% > &e%message%",
"chat_range": 100
}
You can use the placeholder %player% to specify the player's nickname and the placeholder %message% to specify their message in the chat.
You can reload the configuration without restarting the server or the game using the /simplechat command (requires permission level 1 or more).
API
If you are a developer, you can use an event called when a player writes something to the chat.
Look me.vetustus.server.simplechat.api.event.PlayerChatCallback.
To control the behavior, use the ChatMessage subclass, which can be used to cancel sending a message or change it.
Example:
/**
* Prohibits players from writing messages by canceling an event.
*/
PlayerChatCallback.EVENT.register((player, message) -> {
PlayerChatCallback.ChatMessage chatMessage = new PlayerChatCallback.ChatMessage(player, message);
chatMessage.setCancelled(true);
return chatMessage;
});
License
The MIT license is used.
评论 0
登录后参与评分
还没有评论,来抢沙发吧