Pacte: 玩家契约与司法系统
Pacte 是一款创新的 Minecraft Paper 插件,引入了玩家之间动态的社会契约系统。创建联盟、定义明确条款,并通过自动投诉和制裁机制执行正义。无论是和平条约、临时停战还是经济交易,Pacte 都为你的服务器增添了深度的治理与角色扮演层。
核心功能
-
带时长的契约创建
使用以下命令发起契约:/pacte create [duration] <description>
示例: /pacte create 7d We stop griefing each other
- 时长是可选的(
7d、24h、30m、10s 等)。
- 当 duration 到期后,契约将自动取消。
-
通过代码邀请
- 当玩家创建契约时,服务器会生成一个唯一的邀请代码。
- 其他玩家可以使用
/pacte code <code> 加入该契约。
-
自定义制裁
在签署契约之前,创建者必须定义违反契约后的制裁措施:
ban <duration> - 临时封禁(例如 7d、24h)。
money <amount> - 通过 Vault 进行金钱罚款(例如 500)。
-
通过聊天签署契约
设定好制裁后,创建者在聊天中输入契约名称(不含空格)以完成签署。签署后,契约将保持有效,直到过期或明确取消。
-
集成投诉系统
- 任何契约成员都可以提交投诉:
/pacte plainte <pactName> <complaint text>
- 投诉会通过 EssentialsX 邮件即时发送给所有“法官”(拥有
pacte.justice 权限的玩家)。
- 邮件内容包括:契约名称、投诉人姓名、投诉文本以及完整的契约成员列表。
-
惩罚与智能资金分配
法官可以使用以下命令执行契约中预定义的制裁:/pacte punish <pactName> <player1;player2;...>
- 只有契约成员可以被惩罚;无效的名称会触发错误。
- 对于金钱制裁:
- 从每位受罚玩家处扣除指定金额。
- 总金额的 5% 奖励给处理该案件的法官。
- 剩余的 95% 平均分配给非受罚的契约成员。
- 如果所有契约成员都被惩罚,则资金将在符合条件的法官之间平均分配。如果没有符合条件的法官,总金额将存入“待处理池”,并授予下一个新加入服务器的玩家。
- 对于封禁制裁:
-
列出与取消契约
/pacte liste - 显示玩家当前参与的所有契约。
/pacte cancel <pactName> - 取消并删除某个契约。
- 注意: 可由契约创建者或法官(
pacte.justice)使用。但是,如果是契约成员的法官不能管理或取消该契约,以防止利益冲突(除非他们持有 pacte.admin 权限)。
-
自动过期
每个契约都会跟踪其过期时间戳。后台任务会定期检查过期的契约,自动取消它们并通知所有在线成员。
必要整合
- Vault - 用于管理金钱制裁和余额转移。
- EssentialsX - 用于通过游戏内邮件发送投诉。
- LuckPerms(或任何权限管理器):
pacte.use - 基本用户访问权限 (默认:true)。
pacte.justice - 法官(接收投诉、执行制裁、取消契约)。
pacte.admin - 管理员(绕过法官限制,完全控制)。
配置
契约持久存储在 YAML 文件 (pacts.yml) 中。全面的 config.yml 允许完全自定义:
- 所有插件消息的自定义聊天前缀。
- 生成的代码长度和过期持续时间。
- 每个契约允许的最大玩家数量。
- 所有面向用户的消息的完整本地化(创建、错误、投诉、惩罚、取消、过期等)。
- 启用/禁用关于契约操作的控制台日志记录。
致谢
重要提示: 此插件由 AI 使用 Pokrag 的概念和创意进行 vibecode 开发。
Pacte: Player Contracts & Justice System
Pacte is an innovative Minecraft Paper plugin that introduces a dynamic social contract system between players. Create alliances, define clear terms, and enforce justice through automated complaints and sanctions. Whether it is for peace treaties, temporary truces, or economic deals, Pacte adds a deep governance and roleplay layer to your server.
Core Features
-
Pacte Creation with Duration
Initiate a pact using: /pacte create [duration] <description>
Example: /pacte create 7d We stop griefing each other
- The duration is optional (
7d, 24h, 30m, 10s, etc.).
- When the duration expires, the pact is automatically cancelled.
-
Invite by Code
- When a player creates a pact, the server generates a unique invitation code.
- Other players can join the pact using
/pacte code <code>.
-
Custom Sanctions
Before sealing the pact, the creator must define a sanction for breaking it:
ban <duration> - Temporary ban (e.g. 7d, 24h).
money <amount> - Monetary penalty via Vault (e.g. 500).
-
Sealing the Pact via Chat
Once the sanction is set, the creator types the pact name (without spaces) in chat to seal it. After sealing, the pact becomes permanent until expiration or explicit cancellation.
-
Integrated Complaint System
- Any member of a pact can file a complaint:
/pacte plainte <pactName> <complaint text>
- The complaint is instantly sent via EssentialsX mail to all "Judges" (players with the
pacte.justice permission).
- The mail includes: Pact name, Complainant name, Complaint text, and the full list of pact members.
-
Punishments & Smart Money Distribution
Judges can apply the pact's predefined sanction using: /pacte punish <pactName> <player1;player2;...>
- Only pact members can be punished; invalid names trigger an error.
- For Money Sanctions:
- The specified amount is withdrawn from each punished player.
- 5% of the total is awarded to the Judge handling the case.
- The remaining 95% is split equally among non-punished pact members.
- If all pact members are punished, the money is divided equally among eligible Judges. If no Judge is eligible, the total is stored in a "pending pot" and granted to the next new player who joins the server.
- For Ban Sanctions:
- A temporary ban is applied based on the configured duration.
-
Listing and Cancelling Pacts
/pacte liste - Displays all pacts the player is currently part of.
/pacte cancel <pactName> - Cancels and deletes a pact.
- Note: Can be used by the pact creator or a Judge (
pacte.justice). However, Judges who are members of the pact cannot manage or cancel it to prevent conflicts of interest (unless they hold pacte.admin).
-
Automatic Expiration
Each pact tracks its expiration timestamp. A background task regularly checks for expired pacts, automatically cancelling them and notifying all online members.
Essential Integrations
- Vault - Used for managing monetary sanctions and balance transfers.
- EssentialsX - Used to deliver complaints via in-game mail.
- LuckPerms (or any permission manager):
pacte.use - Basic user access (default: true).
pacte.justice - Judges (receive complaints, execute sanctions, cancel pacts).
pacte.admin - Administrators (bypass judge restrictions, full control).
Configuration
Pacts are stored persistently in a YAML file (pacts.yml). A comprehensive config.yml allows full customization:
- Custom chat prefix for all plugin messages.
- Generated code length and expiration duration.
- Maximum number of players allowed per pact.
- Complete localization of all user-facing messages (creation, errors, complaints, punishments, cancellations, expirations, etc.).
- Enable/disable console logging for pact operations.
Credits
Important: This plugin is vibecode by an AI with the Pokrag's concepts and idea.
评论 0
登录后参与评分
还没有评论,来抢沙发吧