aiptu / playerwarn
A PocketMine-MP 插件,允许服务器管理员向玩家发布警告并跟踪他们的警告历史。
1.1.0
2023-08-13 07:00 UTC
Requires
- pocketmine/pocketmine-mp: ^5.0
Requires (Dev)
- phpstan/extension-installer: ^1.3
- phpstan/phpstan: ^1.10
- phpstan/phpstan-strict-rules: ^1.5
This package is auto-updated.
Last update: 2024-09-26 19:46:17 UTC
README
A PocketMine-MP 插件,允许服务器管理员向玩家发布警告并跟踪他们的警告历史。
功能
- 玩家警告系统:一个综合系统,可以对违反服务器规则或表现不当的玩家发布警告。
- 警告限制:设置玩家可以累积的警告数量限制,当达到限制时触发操作。
- 可定制惩罚:为超过警告限制的玩家定义各种类型的惩罚,包括踢出、封禁和IP封禁。
- 延迟惩罚:安排在指定延迟后激活惩罚,给玩家纠正行为的时间。
- 警告过期:为警告分配过期日期;当警告过期时,玩家会收到通知。
- Discord 集成:通过 webhooks 与 Discord 集成,以接收与警告相关的事件、惩罚等通知。
- 玩家通知:玩家在加入时收到通知,显示他们的当前警告数量、上次登录以来的新警告以及活动惩罚。
- 更新通知:可选地通知管理员插件更新,以确保使用的是最新版本。
- 可定制警告消息:自定义发送给玩家的警告或警告过期的警告消息。
- 可定制惩罚消息:为每种惩罚类型定义自定义消息,在应用惩罚时显示。
- 待处理惩罚:为离线玩家排队待处理的惩罚,确保他们在登录时应用。
- 易于管理:使用命令发布警告、删除警告、清除玩家的所有警告以及查看警告历史。
- 灵活配置:高度可定制的配置选项,以适应特定服务器的需求。
- 事件处理:利用事件监听器跟踪玩家行为并基于警告和惩罚触发适当的响应。
- 全面日志记录:记录错误、警告和重要事件,以保持与警告和惩罚相关的重大活动的记录。
默认配置
# PlayerWarn Configuration # Do not change this (Only for internal use)! config-version: 1.0 # Enable or disable the auto update checker notifier. update_notifier: true # Warning settings warning: # The `limit` option specifies the maximum number of warnings a player can receive before punishment is applied. # Set to a positive integer. Default value: 3 limit: 3 # The `delay` option specifies the delay time in seconds before applying the punishment. # If the delay is greater than 0, a warning message will be sent to the player. # If the delay is 0 or negative, the punishment will be applied immediately without delay. # Default value: 5 delay: 5 # The `message` option specifies the warning message template to be sent to the player. # The `{delay}` placeholder will be replaced with the actual delay time in seconds. # You can use color codes by using "§" or "&" before the color code. # Default value: '&cYou have reached the warning limit. You will be punished in {delay} seconds.' message: '&cYou have reached the warning limit. You will be punished in {delay} seconds.' # Punishment settings punishment: # The `type` option specifies the type of punishment to apply when a player reaches the warning limit. # Valid options are "kick", "ban", "ban-ip", and "none". # - "kick": Kicks the player from the server when the warning limit is reached. # - "ban": Bans the player from the server when the warning limit is reached. # - "ban-ip": Bans the player's IP address from the server when the warning limit is reached. # - "none": No punishment will be applied when the warning limit is reached. # Default value is "none". type: none # Custom punishment messages for each type of punishment. # These messages will be shown to the player when the punishment is applied. # You can use color codes by using "§" or "&" before the color code. # Note: Custom messages are only applicable when the `type` is not "none". messages: # Custom message for the "kick" punishment type. kick: '&cYou have been kicked for reaching the warning limit.' # Custom message for the "ban" punishment type. ban: '&cYou have been banned for reaching the warning limit.' # Custom message for the "ban-ip" punishment type. ban-ip: '&cYour IP address has been banned for reaching the warning limit.' # Discord integration settings discord: # Enable or disable the Discord integration. # Set to true to enable the integration, or false to disable it. enabled: false # The Discord webhook URL to send messages to. # Replace 'YOUR_WEBHOOK_URL' with the actual URL of your Discord webhook. # Example: "https://discord.com/api/webhooks/123456789012345678/abcdeFGHiJKLmNOpqRSTUvwxYZ1234567890" webhook_url: "YOUR_WEBHOOK_URL"
Discord 集成
使用这个很棒的网站生成有效的 json 并具有内置预览:Discohook,你也可以用它向服务器发送 webhooks,如果你只是想在频道中添加一些没有自动化的精美嵌入。
-
Discord 上的 Webhook
- 转到 服务器设置 -> Webhooks -> 创建 Webhook
- 设置名称、头像和帖子将发布的频道。复制 Webhook URL。 不要分享!非常危险!
- 点击 保存 然后点击 完成 按钮
-
启用 Discord 集成
- 打开 config.yml 文件。
- 找到 discord 部分,并将 enabled 更改为 true。
- 在 webhook_url 下方粘贴 webhook URL。
命令
PlayerWarn 插件提供了以下命令用于块清理
/warn <player> <reason> [duration]
:向玩家发布警告的命令。- 权限:
playerwarn.command.warn
- 权限:
/clearwarns <player>
:清除玩家所有警告的命令。- 权限:
playerwarn.command.warn
- 权限:
/warns [player]
:查看所有警告的命令。- 权限:
playerwarn.command.warn
- 权限:
权限
要控制对 PlayerWarn 插件提供的命令的访问,以下权限可用
playerwarn.command.warn
:允许玩家使用/warn
命令。playerwarn.command.clearwarns
:允许玩家使用/clearwarns
命令。playerwarn.command.warns
:允许玩家使用/warns
命令。
使用您选择的权限管理插件,将这些权限授予特定的玩家组或个人。
即将推出的功能
- 目前没有计划。您可以贡献或建议新功能。
补充说明
- 如果您发现错误或想提出建议,请访问这里。
- 我们接受所有贡献!如果您想贡献,请在这里提交拉取请求这里。
- 图标来自www.flaticon.com