ServerTrades
为 Paper/Purpur 26.3 提供安全、直接的点对点物品交易功能。 一名玩家执行 /trade <player>,另一名玩家接受后,双方将打开一个共享的交易 GUI,在其中放置物品并确认,随后原子性地交换。
ServerTrades 的核心设计围绕防刷机制:每次点击交易按钮的操作都会被取消,物品的移动由插件手动处理,因此物品仅存在于交易会话中——绝不会出现在鼠标指针上——并且会被准确交付或返还一次。
功能特性
- 请求流程 —
/trade <player> 发送交易请求;目标玩家可选择接受或拒绝。支持配置请求超时时间和冷却时间。
- 双重确认 GUI — 双方玩家最多可放置一定数量的物品(数量可配置),标记就绪后,倒计时结束前执行原子性交换。
- 交易聊天 — 每个交易拥有独立的私聊频道,可在 GUI 内或通过
/trade chat 切换。
- 物品黑名单 — 根据材料类型以及可选的 Lore(描述)模式(例如 "Soulbound"、"Untradeable")阻止特定物品的交易。
- 请求开关 — 玩家可通过
/trade toggle 关闭接收交易请求的功能。
- 后台超时保护 — 若玩家关闭交易 GUI,计时器(支持重新打开)将在自动取消会话之前提供保护。
- 中断交易持久化 — 因崩溃或退出而中断的交易中的物品会保存至磁盘,并在之后安全返还。
- 可选 CombatLOG 集成 — 当玩家处于 PvP 标记状态时阻止或取消交易(若未安装 CombatLOG 则跳过此检查)。
- 可选 PlayerSettings 集成 — 支持按玩家设置语言。
- 可配置的距离限制、音效以及采用 MiniMessage 样式设计的 GUI。
命令
| 命令 |
描述 |
权限节点 |
/trade <player> (别名: /t) |
向指定玩家发送交易请求 |
servertrades.use |
/trade |
如果你有一个活跃的交易,重新打开交易 GUI |
servertrades.use |
/trade accept |
接受传入的交易请求 |
servertrades.use |
/trade deny |
拒绝传入的交易请求 |
servertrades.use |
/trade cancel |
取消你当前的活跃交易或已发出的请求 |
servertrades.use |
/trade toggle |
切换你是否接收交易请求 |
servertrades.use |
/trade chat |
切换当前活跃交易的私聊频道 |
servertrades.use |
/trade reload |
重新加载配置文件和语言文件 |
servertrades.admin |
权限节点
| 节点 |
描述 |
默认值 |
servertrades.use |
使用 /trade 及其子命令 |
true |
servertrades.admin |
访问管理命令(例如 /trade reload) |
op |
配置说明
config.yml 的关键部分如下:
trade:
request-timeout: 60
request-cooldown: 10
accept-countdown: 5
max-distance: -1 # -1 = 无距离限制
cancel-on-damage: false
cancel-on-move: false
background-timeout-seconds: 120
max-items-per-trade: 8
blacklisted-items:
- BEDROCK
- COMMAND_BLOCK
- BARRIER
- STRUCTURE_BLOCK
- SPAWNER
blacklist-by-lore:
enabled: false
patterns:
- "Soulbound"
- "Untradeable"
combat:
# 需要 CombatLOG;如果未安装则跳过相关检查。
block-in-combat: true
cancel-on-combat: true
persist-interrupted-trades: true
log-trades: true
完整配置文件还涵盖了 GUI 标题/材质/状态文本以及完整的音效集。
安装步骤
- 需要 Paper 或 Purpur 26.3 以及 Java 25(2.0.0 版本运行于 26.2,1.x 版本运行于 1.21.x)。
- 将
ServerTrades-2.0.0.jar 放入服务器的 plugins/ 文件夹中。
- 启动服务器以生成
config.yml,然后调整超时时间、物品数量和黑名单设置。
- (可选)安装 CombatLOG 以便在 PvP 期间限制交易,和/或安装 PlayerSettings 以实现按玩家设置语言。
依赖项
- 无需额外依赖。 CombatLOG 和 PlayerSettings 为可选插件,会在运行时自动检测。
支持 / 源码
源代码:
ServerTrades
Safe, direct player-to-player item trading for Paper/Purpur 26.3. One player runs /trade <player>, the other accepts, and both open a shared trade GUI where they place items, confirm, and swap atomically.
ServerTrades is built around dupe-safety: every trade click is cancelled and item movement is handled manually, so items live in the trade session — never on the cursor — and are delivered or returned exactly once.
Features
- Request flow —
/trade <player> sends a request; the target accepts or denies. Configurable request timeout and cooldown.
- Dual-confirmation GUI — both players place up to a configurable number of items, mark ready, and a countdown runs before the atomic swap.
- Trade chat — a private per-trade chat channel toggled in-GUI or via
/trade chat.
- Item blacklist — block trades by material and, optionally, by lore patterns (e.g. "Soulbound", "Untradeable").
- Requests toggle — players can turn incoming trade requests off with
/trade toggle.
- Background timeout — if a player closes the trade GUI, a timer (with reopen support) protects the session before it auto-cancels.
- Interrupted-trade persistence — items from trades interrupted by a crash/quit are stored to disk and returned safely.
- Optional CombatLOG integration — block or cancel trades while players are PvP-tagged (skipped if CombatLOG is absent).
- Optional PlayerSettings integration — per-player language.
- Configurable distance limit, sounds, and MiniMessage-styled GUI.
Commands
| Command |
Description |
Permission |
/trade <player> (alias: /t) |
Send a trade request to a player |
servertrades.use |
/trade |
Reopen the trade GUI if you have an active trade |
servertrades.use |
/trade accept |
Accept an incoming trade request |
servertrades.use |
/trade deny |
Deny an incoming trade request |
servertrades.use |
/trade cancel |
Cancel your active trade or outgoing request |
servertrades.use |
/trade toggle |
Toggle whether you receive trade requests |
servertrades.use |
/trade chat |
Toggle the private trade chat for the active trade |
servertrades.use |
/trade reload |
Reload configuration and language |
servertrades.admin |
Permissions
| Node |
Description |
Default |
servertrades.use |
Use /trade and its subcommands |
true |
servertrades.admin |
Access admin commands (e.g. /trade reload) |
op |
Configuration
Key sections of config.yml:
trade:
request-timeout: 60
request-cooldown: 10
accept-countdown: 5
max-distance: -1 # -1 = unlimited range
cancel-on-damage: false
cancel-on-move: false
background-timeout-seconds: 120
max-items-per-trade: 8
blacklisted-items:
- BEDROCK
- COMMAND_BLOCK
- BARRIER
- STRUCTURE_BLOCK
- SPAWNER
blacklist-by-lore:
enabled: false
patterns:
- "Soulbound"
- "Untradeable"
combat:
# Requires CombatLOG; checks are skipped if it is not installed.
block-in-combat: true
cancel-on-combat: true
persist-interrupted-trades: true
log-trades: true
The full file also covers the GUI title/materials/status text and the complete sound set.
Installation
- Requires Paper or Purpur 26.3 and Java 25 (2.0.0 runs on 26.2, 1.x on 1.21.x).
- Drop
ServerTrades-2.0.0.jar into your server's plugins/ folder.
- Start the server to generate
config.yml, then adjust timeouts, item limits, and blacklists.
- (Optional) Install CombatLOG to gate trading during PvP, and/or PlayerSettings for per-player language.
Dependencies
- None required. CombatLOG and PlayerSettings are optional, detected at runtime.
Support / Source
Source code:
评论 0
登录后参与评分
还没有评论,来抢沙发吧