PlayerMessages+
适用于 Minecraft Java 26.3 的 Paper 插件。该插件支持两种形式的玩家加入、离开和重新加入(详见下文)自定义消息。第一种形式是服务器管理员在 JSON 文件中设置的消息列表(每种消息类型对应一个单独的文件,支持 MiniMessage 格式),如果启用了此功能,系统将从中随机选取一条消息。第二种形式是个人消息,每个玩家可以通过游戏内的命令为自己设置(同样支持 MiniMessage)。对于这两种形式,我们都添加了 <player> 标签,它将被替换为玩家的名称。服务器管理员也可以禁用个人消息功能。如果两者都启用了(个人消息和自定义消息,其中“自定义”指代 JSON 列表),则个人消息优先。如果为该消息类型未启用任何一项,则会显示原版(样式)消息。
该插件还支持 DiscordSRV 集成,如下文所述。这是可选功能,因此您的服务器无需安装 DiscordSRV 即可使用本插件。
玩家功能:
非 OP 玩家可用的功能包括:设置、重置和查看自己的个人消息。
他们可以使用以下命令:
/pmp help:显示所有玩家命令列表。
/pmp set <type> <text>:设置你加入、离开或重新加入时的个人消息。
/pmp see <type> <true|false>:如果你设置了加入、离开或重新加入的个人消息,则显示当前消息。如果传入 false,消息将显示 MiniMessage 标签而非格式化后的消息,默认为 true。
/pmp reset <type>:移除你加入、离开或重新加入时的个人消息。
管理员功能:
管理员功能目前受操作员权限限制,我可能会在未来的更新中使其更具可配置性,但暂时如此。管理员可以更改设置、查看并修改其他玩家的个人消息、禁用你不希望允许的特定 MiniMessage 标签,以及禁止滥用个人消息的玩家使用其个人消息功能。
若要在玩家在加入窗口内重新加入时完全静音离开和加入消息,只需同时禁用 useCustomRejoinMessages 和 usePersonalRejoinMessages。在这种情况下,游戏将忽略 suppressLeaveMessageDuringRejoin 设置,仅在重新加入窗口过期后才发送离开消息。
他们可使用以下命令(与集成相关的命令在下文相关部分指定):
/pmpadmin help:显示所有管理员命令列表。
/pmpadmin settings:显示当前所有服务器设置,不包括 MiniMessage 标签状态。
/pmpadmin verify:检查消息 JSON 文件、封禁 JSON 文件和 config.yaml 文件是否有效和/或包含无效条目,并告知您存在的问题。
/pmpadmin reload:无需重启服务器即可重新加载所有 JSON 文件和 config.yaml。不会重新加载格式错误的文件,但对于包含格式错误条目的文件会发出警告但仍会传递它们。建议在此命令之前运行 verify。
/pmp ban <player>:禁止某玩家使用个人消息。他们存储的消息不会被删除,但将不再显示。
/pmpadmin unban <player>:恢复被封禁玩家使用个人消息的能力。
/pmpadmin banlist:列出所有当前被封禁的玩家(所有封禁命令仅影响此插件,不会阻止玩家加入服务器)。
/pmpadmin useCustomJoinMessages <true\|false>:启用或禁用来自服务器 JSON 文件的加入消息。
/pmpadmin useCustomRejoinMessages <true\|false>:启用或禁用来自服务器 JSON 文件的重新加入消息。
/pmpadmin useCustomLeaveMessages <true\|false>:启用或禁用来自服务器 JSON 文件的离开消息。
/pmpadmin usePersonalJoinMessages <true\|false>:启用或禁用个人加入消息的使用。
/pmpadmin usePersonalRejoinMessages <true\|false>:启用或禁用个人重新加入消息的使用。
/pmpadmin usePersonalLeaveMessages <true\|false>:启用或禁用个人离开消息的使用。
/pmpadmin rejoinMessageWindow <seconds>:设置断开连接后多长时间内再次加入被视为“重新加入”。
/pmpadmin suppressLeaveMessageDuringRejoin <seconds>:设置服务器等待以确定下次加入是否成为“重新加入”期间,延迟发送离开消息的时间长度。设置为 0 时,离开消息将像往常一样立即发送。
/pmpadmin minimessageTags <category> <true\|false>:启用或禁用个人消息的 MiniMessage 格式标签(不影响来自服务器自定义 JSON 列表的消息)。可用类别:colors, bold, italic, underlined, strikethrough, obfuscated, gradient, rainbow。禁用颜色也将停止 rainbow 和 gradient 等标签应用其颜色值。
DiscordSRV 集成:
DiscordSRV 集成默认处于禁用状态,除非插件在您的 plugins 文件夹中检测到 DiscordSRV,否则无法启用。您可以在此 Modrinth 页面找到 DiscordSRV!
PlayerMessages+ 支持 DiscordSRV 集成,这建立了以下功能:能够显示自定义和个人加入、重新加入和离开消息,以替代默认的 DiscordSRV 消息;实际上还能发送重新加入消息(如果禁用此集成,DiscordSRV 将不会这样做)。这也是允许 PlayerMessages+ 控制 DiscordSRV 何时发送或不发送加入、离开或重新加入消息的关键机制,这在我们需要永久或暂时抑制离开和加入消息以等待重新加入的情况下是必需的。
由于消息发送至 Discord 的方式,MiniMessage 标签无法在那里使用。因此,所有发送至 Discord 的自定义和个人消息都会剥离所有 MiniMessage 标签,仅保留文本内容。<player> 标签会在标签被剥离之前替换为玩家的 Minecraft 名称,因此它是唯一在发送至 Discord 时“有效”的标签。
服务器管理员可使用以下命令来控制此集成:
/pmpadmin integration DiscordSrv help:显示与 DiscordSRV 集成相关的所有管理员命令列表。
/pmpadmin integration DiscordSrv settings:显示当前所有 DiscordSRV 集成设置,以及插件是否能在你的服务器上找到 DiscordSRV。
/pmpadmin integration DiscordSrv enabled <true|false>:启用或禁用 DiscordSRV 集成。如果未找到任何 DiscordSRV 实例,该命令将拒绝启用。
/pmpadmin integration DiscordSrv useCustomMessages <true|false>:启用或禁用 DiscordSRV 是否使用 Discord 中自定义和个人消息的确切内容。如果禁用,则将发送一条默认消息,其内容与没有此集成时 DiscordSRV 发送的内容相同。
重要提示: 如果你启用了此集成,强烈建议你在 DiscordSRV 的 messages.yaml 中禁用加入(join)、首次加入(firstjoin)和离开(leave)消息。否则可能导致每次加入或离开时发送多条消息!因此,要么禁用这些消息并让 PlayerMessages+ 处理何时发送消息,要么完全不使用此集成,让 DiscordSRV 执行其默认操作(这意味着 Minecraft 聊天和 Discord 聊天看到的内容可能会有所不同)。
默认设置
以下是插件的默认设置。如果有任何不符合你的需求,请确保对其进行更改,可以直接在配置文件中修改,也可以使用上述列出的命令。如果你想编辑配置文件或自定义消息列表,它们将位于 "plugins -> PlayerMessagesPlus" 中。
- useCustomJoinMessages: true
- usePersonalJoinMessages: true
- useCustomLeaveMessages: true
- usePersonalLeaveMessages: true
- useCustomRejoinMessages: true
- usePersonalRejoinMessages: true
- rejoinMessageWindow: 30
- suppressLeaveMessageDuringRejoin: 0
minimessageTags:
- colors: true
- bold: true
- italic: true
- underlined: true
- strikethrough: true
- obfuscated: true
- gradient: true
- rainbow: true
DiscordSRV integration:
- enabled: false
- useCustomMessages: true
如何报告错误或请求功能?
两者都可以通过在项目 GitHub 页面 上提交 issue 来完成。我自己也在使用这个插件,因此错误可能会尽快得到修复,但功能可能需要更多时间,因为这并非我的日常工作。
PlayerMessages+
Paper plugin for Minecraft Java 26.3. This plugin supports custom join- leave- and rejoin (more on that later) messages for players in 2 forms. The first is a list of messages set by the server admins in a json file (seperate file for each message type with minimessage formatting support), from which a random message is picked if these are enabled. The seconds is personal messages, which each player can set through a command ingame for themselves (also with minimessage support, for both forms we added the <player> tag which will be replaced by the players name). This can also be disabled by server admins. If both are enabled (personal and custom messages, with custom reffering to the json lists), the personal message takes priority. If neither are enabled for that message type, a vanilla (style) message will be displayed.
The plugin also has integration with DiscordSRV as described below. This is optional, so your server does not NEED DiscordSRV to use this plugin.
Player features:
The features available to non-opped players consist of: Setting- resetting- and checking their own personal messages.
the following commands are available for them:
/pmp help: Show a list of all player commands.
/pmp set <type> <text>: Set your personal message for join, leave, or rejoin.
/pmp see <type> <true|false>: Show your current personal message for join, leave, or rejoin if one is set. If false is given, the message will display the minimessage tags instead of the formatted message, defaults to true.
/pmp reset <type>: Remove your personal message for join, leave, or rejoin.
Admin features:
Admin features are currently locked behind operator permissions, which I might change in future updates to be more configurable, but this will be it for the time being. Admins can change settings, see and alter personal messages from other players, disable specific minimessage tags you dont want to allow and ban players from using their personal messages should someone abuse theirs.
To completely silence leave and join messages when players rejoin within the join window, simply disable both useCustomRejoinMessages and usePersonalRejoinMessages. In this instance the game will ignore the suppressLeaveMessageDuringRejoin setting and only send a leave message after the rejoin window has expired.
The following commands are available for them (integration related commands are specified in their related sections below):
/pmpadmin help: Show a list of all admin commands.
/pmpadmin settings: Shows all the current server settings, excluding MiniMessage tag statusses.
/pmpadmin verify: Checks if the message json files, bans json file and config.yaml file are valid and/or contain invalid entries and informs you of issues.
/pmpadmin reload: Reloads all json files and the config.yaml without needing to restart the server. Will not reload malformed files, but will pass files with malformed entiries with a warning. It is recommended to run verify before this.
/pmp ban <player>: Bans a player from using personal messages. Their stored messages will not be removed, but will simply not be displayed.
/pmpadmin unban <player>: Restore's a banned players ability to use personal messages.
/pmpadmin banlist: Gives a list of all currently banned players (all the ban commands only affect this plugin, it does not stop players from joining the server).
/pmpadmin useCustomJoinMessages <true\|false>: Enable or disable the join messages from the servers json file.
/pmpadmin useCustomRejoinMessages <true\|false>: Enable or disable the rejoin messages from the servers json file.
/pmpadmin useCustomLeaveMessages <true\|false>: Enable or disable the leave messages from the servers json file.
/pmpadmin usePersonalJoinMessages <true\|false>: Enable or disable the use of personal join messages.
/pmpadmin usePersonalRejoinMessages <true\|false>: Enable or disable the use of personal rejoin messages.
/pmpadmin usePersonalLeaveMessages <true\|false>: Enable or disable the use of personal leave messages.
/pmpadmin rejoinMessageWindow <seconds>: Set for how long after a disconnect the next join counts as "rejoining".
/pmpadmin suppressLeaveMessageDuringRejoin <seconds>: Set for how long leave messages will be held back whilst the server waits to see if the next join becomnes a "rejoin". When set to 0 the leave message is send immediately as usual.
/pmpadmin minimessageTags <category> <true\|false>: Enable or disable a MiniMesssage formatting tag for personal messages (does not affect messages from the server's custom json list). Available categories: colors, bold, italic, underlined, strikethrough, obfuscated, gradient, rainbow. Disabling colours will also stop tags like rainbow and gradient from applying their colour values.
DiscordSRV Integration:
DiscordSRV integration is disabled by default and cannot be enabled unless the plugin detects DiscordSRV in your plugins folder. You can find DiscordSRV on this Modrith page!
PlayerMessages+ supports DiscordSRV integration, which establishes the following: The ability to show the custom and personal join-, rejoin- and leave messages instead of the default DiscordSRV messages and in fact to send rejoin messages at all (which discordSRV will not do if this integration is disabled). It is also what allows PlayerMessages+ to control when DiscordSRV does and doesn't send join- leave or rejoin messages, which is needed for the cases where we permanently or temporaraly supress leave and join messages whilst waiting for rejoins.
Due to the way the messages are send to discord, MiniMessage tags cannot be used there. Therefore any custom and personal messages send to discord will be stripped of all MiniMessage tags, retaining only the text. The <player> tag will be replaced by the player's minecraft name before tags are stripped, so is the only tag that "works" when send to discord.
The following commands are available for server admins to control this integration:
/pmpadmin integration DiscordSrv help: Shows a list of all admin commands related to DiscordSRV integration.
/pmpadmin integration DiscordSrv settings: Shows all the current DiscordSRV integration settings and if the plugin was able to find DiscordSRV on your server.
/pmpadmin integration DiscordSrv enabled <true|false>: Enable or disable DiscordSRV integration. The command will refuse to enable if no instance of DiscordSRV could be found.
/pmpadmin integration DiscordSrv useCustomMessages <true|false>: Enable or disable wether DiscordSRV uses the exact content of custom and personal messages in discord. If disabled a default message will be send instead which is identical to what DiscordSRV would send without this integration.
Important: If you enable this integration it is highly reccomended you disable join- firstjoin- and leave messages in DiscordSRV's messages.yaml. Failing to do so may result in multiple messages being send per join or leave! So either disable those and let PlayerMessages+ handle when to send the messages, or choose not to use the integration at all and let DiscordSRV do its default thing (meaning what minecraft chat and discord chat sees might differ).
Default settings
These are the plugins default setting. If any are not to your liking make sure to change them, either directly in the config files or with the commands listed above. If you want to edit the config or the custom message lists, they will be in the "plugins -> PlayerMessagesPlus".
- useCustomJoinMessages: true
- usePersonalJoinMessages: true
- useCustomLeaveMessages: true
- usePersonalLeaveMessages: true
- useCustomRejoinMessages: true
- usePersonalRejoinMessages: true
- rejoinMessageWindow: 30
- suppressLeaveMessageDuringRejoin: 0
minimessageTags:
- colors: true
- bold: true
- italic: true
- underlined: true
- strikethrough: true
- obfuscated: true
- gradient: true
- rainbow: true
DiscordSRV integration:
- enabled: false
- useCustomMessages: true
How can I report bugs or request features?
Both can be done by opening an issue on the project's github page. I use this plugin myself, so bugs are likely to be fixed as soon as I can, however features may take soke more time as this is not a job for me.
评论 0
登录后参与评分
还没有评论,来抢沙发吧