为你的服务器经济系统提供掷硬币投注功能。一名玩家投入资金,另一名玩家匹配等额赌注,由一枚硬币决定谁赢得奖池。兼容任意 Vault 经济插件,拥有简洁的图形用户界面(GUI),并为基岩版玩家(Geyser/Floodgate)提供原生表单。
我制作 CoinflipXD 是因为我之前尝试过的所有掷硬币插件都已停止维护、存在物品复制漏洞,或者在新版 Minecraft 中无法正常运行。
功能特性
- 公开与私密投注。
/cf 5k发布任何人都可参与的公开投注,/cf Steve 5k向特定玩家发起挑战。 - 投注浏览 GUI 带有确认界面,以及 Floodgate 玩家的 Bedrock 表单。
- 赌注不会丢失。 每一笔赌注在被接受时都会被立即记录。如果服务器在投注过程中崩溃或停止,下次启动时将自动退款。
- 公平的硬币 来自加密安全随机数生成器。每次结果都会记录到控制台。
- 税费 对 winnings 征收,可从经济系统中移除或支付给某个玩家账户。
- 限制: 最小和最大投注额、玩家余额的最大百分比、每名玩家同时只能有一个开放投注,以及针对每个玩家可设置的金额以上确认界面。
- 简写金额 如
50k、1.5m或2b。 - 统计数据: 胜场、负场、赢得和输掉的金钱。
- 英文和德文 消息,全部可通过 MiniMessage 编辑。
- Minecraft 1.21 至 26.x 支持 Paper、Purpur、Spigot、Bukkit 和 Folia。一个 jar 文件适用于所有版本。
命令
/coinflip 与 /cf 等效。
| 命令 | 权限 | 功能 |
|---|---|---|
/cf |
coinflip.use |
打开投注浏览器 |
/cf <amount> |
coinflip.use |
发布公开投注 |
/cf <player> <amount> |
coinflip.private |
向某玩家发起挑战 |
/cf <player> accept / deny |
coinflip.use |
回答挑战(或在聊天中点击按钮) |
/cf cancel |
coinflip.use |
取消你的投注并收回资金 |
/cf stats [player] |
coinflip.use |
查看胜场、负场及总额统计 |
/cf confirmmin <amount|default> |
coinflip.use |
仅在此金额以上请求确认 |
/cf cancel <player> |
coinflip.admin |
取消其他玩家的投注 |
/cf reload |
coinflip.admin |
重新加载配置和消息文件 |
coinflip.use 默认授予所有玩家;coinflip.private 不授予任何人。coinflip.bypass.minmax 可忽略投注限额,而 coinflip.notify(默认由 OP 拥有)在派彩或退款失败时会收到通知。
安装
- 安装 Vault 以及一个经济类插件,例如 EssentialsX。
- 将 CoinflipXD 放入
plugins/目录并重启服务器。 - 调整
plugins/CoinflipXD/config.yml中的配置,然后运行/cf reload。
对于基岩版玩家,请安装 Geyser 和 Floodgate。CoinflipXD 会自动为它们切换至表单界面。
配置
config.yml
economy:
min-bet: 100
max-bet: 100000
# 每注允许使用的玩家余额最大百分比(0-100)
max-balance-percent: 100.0
require-whole-numbers: true
tax:
enabled: true
# 从每次获胜中抽取的奖池比例
percent: 10.0
# "server" 会将抽税金额移出经济系统。或者指定玩家名称或 UUID 以接收该金额。
recipient: "server"
ui:
browser:
rows: 6
items-per-page: 45
# 公开投注和私人挑战过期(并退款)前的秒数
expire-seconds: 120
private-expire-seconds: 60
# 低于此金额的投注会跳过确认屏幕(0 = 始终确认)
create-confirm-min: 0
# Bukkit 音效名称(UI_BUTTON_CLICK)或键名(minecraft:ui.button.click)。设为 "none" 则静音。
sounds:
open: UI_BUTTON_CLICK
accept: ENTITY_EXPERIENCE_ORB_PICKUP
win: UI_TOAST_CHALLENGE_COMPLETE
lose: BLOCK_ANVIL_LAND
limits:
one-active-per-player: true
broadcast:
# 在聊天中公告新的公开投注
enabled: false
message: "<gray>%player% 创建了一个金额为 <aqua>$%amount%</aqua> 的硬币翻转。</gray>"
messages-format: MINI_MESSAGE
messages-language: "en" # en 或 de
须知
- 无人接手的投注会过期并被退款。离开服务器会取消你的投注并退还资金。
- 当税收接收者设置为
server时,抽税金额将从经济系统中移除,使硬币翻转成为消耗资金的机制。 - 统计数据和开放投注存储在
plugins/CoinflipXD/data.db中。
支持
Bug 和想法:GitHub issues 或 Discord。
Coinflip betting for your server's economy. One player puts money in, another matches it, and a coin decides who takes the pot. Works with any Vault economy, has a clean GUI, and gives Bedrock players (Geyser/Floodgate) native forms.
I made CoinflipXD because every coinflip plugin I tried was abandoned, had dupe glitches, or broke on new Minecraft versions.
Features
- Public and private bets.
/cf 5kposts a bet anyone can take,/cf Steve 5kchallenges one player. - Bet browser GUI with confirm screens, and Bedrock forms for Floodgate players.
- Stakes can't get lost. Every stake is recorded the moment it is taken. If the server crashes or stops in the middle of a bet, it is refunded automatically on the next start.
- Fair coin from a cryptographically secure random generator. Every result is logged to the console.
- Tax on winnings, removed from the economy or paid to a player account.
- Limits: min and max bet, max % of a player's balance, one open bet per player, and a confirmation screen above an amount each player can set.
- Shorthand amounts like
50k,1.5mor2b. - Stats: wins, losses, money won and lost.
- English and German messages, all editable with MiniMessage.
- Minecraft 1.21 to 26.x on Paper, Purpur, Spigot, Bukkit and Folia. One jar for every version.
Commands
/coinflip works as well as /cf.
| Command | Permission | What it does |
|---|---|---|
/cf |
coinflip.use |
Open the bet browser |
/cf <amount> |
coinflip.use |
Post a public bet |
/cf <player> <amount> |
coinflip.private |
Challenge a player |
/cf <player> accept / deny |
coinflip.use |
Answer a challenge (or click the buttons in chat) |
/cf cancel |
coinflip.use |
Cancel your bet and get your money back |
/cf stats [player] |
coinflip.use |
Wins, losses and totals |
/cf confirmmin <amount|default> |
coinflip.use |
Only ask for confirmation above this amount |
/cf cancel <player> |
coinflip.admin |
Cancel someone else's bet |
/cf reload |
coinflip.admin |
Reload the config and messages |
coinflip.use is given to everyone by default; coinflip.private to no one. coinflip.bypass.minmax ignores the bet limits, and coinflip.notify (op by default) gets a message if a payout or refund ever fails.
Installation
- Install Vault and an economy plugin such as EssentialsX.
- Put CoinflipXD in
plugins/and restart. - Adjust
plugins/CoinflipXD/config.ymland run/cf reload.
For Bedrock players, install Geyser and Floodgate. CoinflipXD switches to forms for them automatically.
Configuration
config.yml
economy:
min-bet: 100
max-bet: 100000
# Maximum percentage of a player's balance allowed per bet (0-100)
max-balance-percent: 100.0
require-whole-numbers: true
tax:
enabled: true
# Percentage of the pot taken from each win
percent: 10.0
# "server" removes taxed money from the economy. Or give a player name or UUID to receive it.
recipient: "server"
ui:
browser:
rows: 6
items-per-page: 45
# Seconds before public bets and private challenges expire (and get refunded)
expire-seconds: 120
private-expire-seconds: 60
# Bets below this amount skip the confirm screen (0 = always confirm)
create-confirm-min: 0
# Bukkit sound names (UI_BUTTON_CLICK) or keys (minecraft:ui.button.click). "none" for silence.
sounds:
open: UI_BUTTON_CLICK
accept: ENTITY_EXPERIENCE_ORB_PICKUP
win: UI_TOAST_CHALLENGE_COMPLETE
lose: BLOCK_ANVIL_LAND
limits:
one-active-per-player: true
broadcast:
# Announce new public bets in chat
enabled: false
message: "<gray>%player% created a coinflip for <aqua>$%amount%</aqua>.</gray>"
messages-format: MINI_MESSAGE
messages-language: "en" # en or de
Good to know
- Bets that nobody takes expire and are refunded. Leaving the server cancels your bet and refunds it.
- With the tax recipient set to
server, taxed money leaves the economy, which makes coinflips a money sink. - Stats and open stakes are stored in
plugins/CoinflipXD/data.db.
Support
Bugs and ideas: GitHub issues or Discord.
下载 CoinflipXD
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 CoinflipXD
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 CoinflipXD
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 CoinflipXD
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 CoinflipXD
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 CoinflipXD
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 CoinflipXD
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 CoinflipXD
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
每个服务器一个 jar 包:适用于 Minecraft 1.21 至 26.3 的 Paper、Purpur、Spigot、Bukkit 和 Folia(单独的 Java 25 版 1.2 jar 包不再需要)。jar 包体积从 15 MB 缩减至约 1 MB,因为它现在使用每个服务器都已自带的 SQLite 驱动。
资金安全
- 每笔赌注在押注时即刻记录。如果服务器在投注期间崩溃或停止,下次启动时会自动退还赌注。此前则无法退款。
- 关闭时未结算的赌注仅在经济插件仍在运行时退款;否则将在下次启动时退款,而非静默失败。
- 接受、支付和退款操作在一个加锁步骤中完成,因此即使在 Folia 上,一笔赌注也绝不会被重复接受。
- 如果向赢家付款失败,双方玩家将拿回各自的赌注。
- 重启前写入的统计数据不再丢失。
已修复
- 1.2 版本在 Spigot 和 Bukkit 上启动时崩溃(因其调用了仅 Paper 支持的调度器方法)
/cf <player> <amount>(文档中显示的命令)无法正常工作;只有/cf <amount> <player>有效。现在两者均可用。- 拖入掷硬币菜单的物品在菜单关闭后消失
- 如果在菜单打开期间列表发生变化,点击浏览器中的某笔赌注可能会打开另一笔赌注
- 如果经济插件在插件加载后才通过 Vault 注册,插件会自我禁用
/cf stats <name>命令及税收接收者可能因网络查询导致服务器冻结- 被挑战的玩家会收到“你的掷硬币已过期。已退还 $X”的消息,尽管他们从未付款;现在他们将收到自己的专属消息,而创建者会在挑战被拒绝时收到通知
- 开启税收功能时,小数赌注的 payouts 会被向下取整为整数;现在会保留小数位
- 每次启动时都会出现“messages.yml 已存在”的警告
变更
coinflip.admin和coinflip.notify权限默认授予 op- 新增
/coinflip别名 - 音效也可以使用键名形式指定,例如
minecraft:ui.button.click,或设为none - 税收接收者可以是 UUID
- 在 Paper 上,插件使用服务器自带的 Adventure 库,而非内置副本
- 新增以下消息:
target-busy、denied、challenge-expired、challenge-canceled、challenge-declined、refund-pending、payout-failed(这些将自动添加到现有的消息配置文件中)
CoinflipXD v1.2
兼容性
- 添加 Folia 兼容支持(
folia-supported: true)及 Folia 安全的调度机制。 - 发布两个 JAR 文件:
- Java 21 版本的 JAR,适用于 Minecraft 1.21.x
- Java 25 版本的 JAR,适用于 Minecraft 26.x
说明
- 与 v1.1.3 相比无游戏玩法变更;此为兼容性更新与发布工具链改进。
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
插件
PacketEvents 是一款专为 Minecraft Java 版打造的协议库,旨在简化数据包的处理与传输。
插件
ExyliaPlugins 的库。
插件
通过对话框或铁砧界面帮助你的 Anthme
插件
自定义你的Minecraft头像!
插件
重新定义服务器上的生物运输方式。使用高度可定制的口袋道具,安全地捕获、存储和释放任何实体。
插件
为基于 Spigot/Paper/Folia 的服务器添加对 Vivecraft 的支持
评论 0
登录后参与评分
还没有评论,来抢沙发吧