SecureTrade
SecureTrade 是一款适用于 Paper 1.21+ 的安全玩家间交易插件。玩家可以通过共享的交易 GUI 交换物品,并可选地交换货币,该功能包含确认保护、自动取消机制以及交易历史记录。
特性
- 共享交易 GUI
- 每位玩家拥有 16 个物品槽位
- 支持通过 Vault 进行货币交易(可选)
- 双向确认系统
- 完成交易前的最终倒计时
- 任何报价更改时重置确认状态
- 交易取消后返还物品
- 请求超时与冷却时间设置
- 可配置的最大交易距离
- 当玩家断开连接、关闭 GUI、受到伤害或移动过远时自动取消交易
- 背包空间与余额检查
- SQLite 交易历史记录
- 管理员历史查询功能
- 可自定义的消息与音效
- Tab 键补全支持
- 管理员绕过权限
要求
- Paper 1.21 或更高版本
- Java 21
- Vault 及兼容的经济插件为可选安装
Vault 仅在进行货币交易时需要。物品交易无需 Vault 即可运行。
安装
- 下载 SecureTrade
.jar 文件。
- 将其放入服务器的
plugins 文件夹中。
- 如需启用货币交易,请安装 Vault 及一个经济插件。
- 启动或重启服务器。
- 根据需要编辑
plugins/SecureTrade/config.yml。
- 修改配置后使用
/trade reload 命令重载。
使用方法
- 使用
/trade <player> 发送交易请求。
- 对方玩家使用
/trade accept 接受请求。
- 双方将各自物品放入交易 GUI 的己方区域。
- 也可以通过 Shift+点击将物品快速移入交易栏。
- 使用
/trade money <amount> 在报价中加入货币。
- 当报价准备就绪时,点击红色的确认方块。
- 双方确认后,开始短暂倒计时。
- 倒计时结束后,物品和货币将进行交换。
更改物品或金钱报价会重置所有确认状态。图形界面中显示的金锭代表每位玩家当前的金钱报价,而屏障则用于取消交易。
命令
/trade <player> — 发送交易请求
/trade accept [player] — 接受交易请求
/trade deny [player] — 拒绝交易请求
/trade money <amount> — 设置你的金钱报价
/trade cancel — 取消当前交易
/trade history — 查看最近的交易历史
/trade history <player> — 查看其他玩家的交易历史
/trade reload — 重载配置
/securetrade — /trade 的别名
权限
-
securetrade.use — 使用交易系统
默认:所有人
-
securetrade.money — 向交易中添加金钱
默认:所有人
-
securetrade.history — 查看个人交易历史
默认:管理员(Operators)
-
securetrade.history.others — 查看其他玩家的交易历史
默认:管理员(Operators)
-
securetrade.reload — 重载插件配置
默认:管理员(Operators)
-
securetrade.bypass.cooldown — 绕过请求冷却时间
默认:管理员(Operators)
-
securetrade.bypass.distance — 绕过最大交易距离限制
默认:管理员(Operators)
配置
以下设置可在 config.yml 文件中修改:
- 交易请求超时时间
- 请求冷却时间
- 确认倒计时
- 最大交易距离
- 玩家受伤时取消交易
- 启用或禁用金钱交易
- 显示的历史记录条目数量
- 插件消息
- 音效
交易历史
每笔完成的交易都会自动存储在:
plugins/SecureTrade/trades.db
数据库记录了双方玩家、交换的物品、交换的金钱以及完成时间。
默认安全检查
如果发生以下情况,交易将被取消:
- 玩家关闭了交易菜单
- 玩家断开连接
- 玩家受到伤害
- 玩家之间的距离过远
- 玩家的背包空间不足
- 玩家不再拥有足够的金钱
当交易被取消时,所有提供的物品都会安全地返还给它们的原主。
SecureTrade
SecureTrade is a safe player-to-player trading plugin for Paper 1.21+. Players can exchange items and optionally money through a shared trading GUI with confirmation protection, automatic cancellation and trade history.
Features
- Shared trading GUI
- 16 item slots for each player
- Optional money trading with Vault
- Two-sided confirmation system
- Final countdown before completing a trade
- Confirmations reset whenever an offer changes
- Items are returned if a trade is cancelled
- Request timeouts and cooldowns
- Configurable maximum trading distance
- Automatic cancellation when a player disconnects, closes the GUI, takes damage or moves too far away
- Inventory-space and balance checks
- SQLite trade history
- Admin history lookup
- Configurable messages and sounds
- Tab completion
- Bypass permissions for administrators
Requirements
- Paper 1.21 or newer
- Java 21
- Vault and a compatible economy plugin are optional
Vault is only required for money trading. Item trading works without Vault.
Installation
- Download the SecureTrade
.jar file.
- Place it inside your server’s
plugins folder.
- Install Vault and an economy plugin if you want to enable money trading.
- Start or restart the server.
- Edit
plugins/SecureTrade/config.yml if required.
- Use
/trade reload after changing the configuration.
How to Use
- Send a request using
/trade <player>.
- The other player accepts it using
/trade accept.
- Both players place their items into their own side of the trading GUI.
- Items can also be shift-clicked into the trade.
- Use
/trade money <amount> to include money in your offer.
- Click your red confirmation block when your offer is ready.
- Once both players confirm, a short countdown begins.
- The items and money are exchanged when the countdown finishes.
Changing an item or money offer resets both confirmations. The gold ingots in the GUI display each player’s current money offer, while the barrier cancels the trade.
Commands
/trade <player> — Send a trade request
/trade accept [player] — Accept a trade request
/trade deny [player] — Deny a trade request
/trade money <amount> — Set your money offer
/trade cancel — Cancel your current trade
/trade history — View your recent trade history
/trade history <player> — View another player’s trade history
/trade reload — Reload the configuration
/securetrade — Alias for /trade
Permissions
-
securetrade.use — Use the trading system
Default: Everyone
-
securetrade.money — Add money to a trade
Default: Everyone
-
securetrade.history — View personal trade history
Default: Operators
-
securetrade.history.others — View another player’s trade history
Default: Operators
-
securetrade.reload — Reload the plugin configuration
Default: Operators
-
securetrade.bypass.cooldown — Bypass the request cooldown
Default: Operators
-
securetrade.bypass.distance — Bypass the maximum trading distance
Default: Operators
Configuration
The following settings can be changed inside config.yml:
- Trade-request timeout
- Request cooldown
- Confirmation countdown
- Maximum trading distance
- Cancel trades when players take damage
- Enable or disable money trading
- Number of history entries displayed
- Plugin messages
- Sound effects
Trade History
Every completed trade is stored automatically in:
plugins/SecureTrade/trades.db
The database records both players, exchanged items, exchanged money and the completion time.
Default Safety Checks
A trade is cancelled if:
- A player closes the trade menu
- A player disconnects
- A player takes damage
- The players move too far apart
- A player does not have enough inventory space
- A player no longer has enough money
When a trade is cancelled, all offered items are safely returned to their owners.
评论 0
登录后参与评分
还没有评论,来抢沙发吧