金币 / 点券抽奖
这篇做一个「金币宝箱」:单抽 1000 金币,十连打九折 9000 金币。改两个字就能变成点券奖池。
金币要装 Vault 和一个经济插件(例如 EssentialsX、CMI),点券要装 PlayerPoints。
第 1 步:写奖池文件
新建 plugins/StarCrate/crates/jinbi.yml:
display-name: '<gold>金币宝箱'
type: normal
animation: slots
ten-animation: cards
cost:
type: money
single: 1000
ten: 9000
prizes:
- id: bread
item: {material: BREAD, amount: 32}
weight: 45
rarity: common
- id: iron
item: {material: IRON_BLOCK, amount: 2}
weight: 30
rarity: common
- id: gold
item: {material: GOLD_BLOCK, amount: 2}
weight: 17
rarity: rare
- id: diamond
item: {material: DIAMOND_BLOCK}
weight: 6
rarity: epic
- id: apple
item: {material: ENCHANTED_GOLDEN_APPLE}
weight: 2
rarity: legendary
grand: true
cost.type: money 是金币,single 是单抽价格,ten 是十连价格。金币可以有小数,例如 99.5。
第 2 步:重载并测试
/sc reload
/eco give 你的名字 20000
/sc open jinbi
预览的单抽按钮写「花费 1000 金币」。点一次,聊天栏写「已扣除 1000 金币」。钱不够时提示「金币不足,需要 1000」,不会抽。
改成点券
display-name: '<aqua>点券宝箱'
type: normal
animation: slots
ten-animation: cards
cost:
type: points
single: 10
ten: 90
prizes:
- id: diamond
item: {material: DIAMOND, amount: 8}
weight: 70
rarity: rare
- id: netherite
item: {material: NETHERITE_INGOT}
weight: 25
rarity: epic
- id: elytra
item: {material: ELYTRA}
weight: 5
rarity: legendary
grand: true
存成 crates/dianquan.yml。点券只算整数,扣了会提示「已扣除 10 点券」。
在游戏里设也可以
/sc edit jinbi → 「⚙ 奖池设置」→ 「花费类型」左键切换(免费 → 金币 → 点券 → 钥匙),再点「单抽花费」「十连花费」输入数字。
会踩的坑
十连价格一定要写。金币和点券的 ten 写 0 就是十连免费(钥匙才是 0 = 10 把)。不想让人十连,写 ten-pull: false。
没装 Vault 或经济插件时,玩家点抽奖会提示「服务器没有经济插件,无法用金币抽奖」;没装 PlayerPoints 时提示「服务器没有安装 PlayerPoints,无法用点券抽奖」。装好后 /sc reload 重新接入。
抽奖失败要退钱,但经济插件当下不收(例如余额上限),钱会记在 plugins/StarCrate/owed.yml,玩家进服时和之后每 5 分钟自动退还,到账时提示「之前没能退回的 … 已经存进你的钱袋」。
想越抽越贵,金币和点券都能用递增花费,见 越抽越贵。