因为写了过后,无法出售类似于10/20/30这种数量,便询问了作者,作者说用,JS,但是我是小白,不会用JS,有dalao教教我吗?


16:
display:
mats: diamond
slots: 16
name: '&b&l钻石'
lore:
- '&6&l>>>100金币/个'
- '&a左键购买10个'
- '&a右键购买64个'
actions:
left:
- 'Tell: &c金币不足_||_Break:<Requirement: %vault_eco_balance% < 1000>'
- 'Console: eco take %player_name% 1000'
- 'console: minecraft:give %player_name% minecraft:diamond 10'
right:
- 'Tell: &c金币不足_||_Break:<Requirement: %vault_eco_balance% < 6400>'
- 'Console: eco take %player_name% 6400'
- 'console: minecraft:give %player_name% minecraft:diamond 64'
display:
mats: diamond
slots: 16
name: '&b&l钻石'
lore:
- '&6&l>>>100金币/个'
- '&a左键购买10个'
- '&a右键购买64个'
actions:
left:
- 'Tell: &c金币不足_||_Break:<Requirement: %vault_eco_balance% < 1000>'
- 'Console: eco take %player_name% 1000'
- 'console: minecraft:give %player_name% minecraft:diamond 10'
right:
- 'Tell: &c金币不足_||_Break:<Requirement: %vault_eco_balance% < 6400>'
- 'Console: eco take %player_name% 6400'
- 'console: minecraft:give %player_name% minecraft:diamond 64'
使用传送值
本帖最后由 苏子峰 于 2020-8-30 11:23 编辑
本内容来自 @嘿嘿嘿嘿嘿鹰
# {0} 名字name
# {1} 材料mats
# {2} 英文名字
# {3} 变量材料
# {4} 零售价格
# {5} 材料data
'A':
display:
mats: end_crystal
name: '&e&l收购 {0} &8[&b&l{2}&8]'
lore:
- '&8&l&m '
- '&7拥有数量: &a&l%checkitem_amount_mat:{3}% &7个'
- '&8&l&m '
- '&7收购单价:&a&l {4}&a/个'
- '&8&l&m '
- '&a▶ 点击左键'
- '&7出售 &l1 &7个'
- '&8 '
- '&a▶ 点击右键'
- '&7输入收购数量'
- '&8 '
- '&a▶ SHIFT &7+ &a右键'
- '&7出售 &l全部 [%checkitem_amount_mat:{3}%]'
- '&7预计获得 &e%math_{4}*{checkitem_amount_mat:{3},strict}[precision:1]% 金币'
- '&8&l&m '
actions:
all:
- 'sound: BLOCK_NOTE_BLOCK_PLING-1-2'
left:
- 'tell: 你身上没有可出售的物品_||_Break:<Requirement: %checkitem_amount_mat:{3},strict% < 1>'
- 'tell: 已成功出售 1 个{0}, 获得了 {4} 金币'
- 'console: minecraft:clear %player_name% {3} 1'
- 'GIVE-MONEY:{4}'
shift_right:
- 'tell: 你身上没有可出售的物品_||_Break:<Requirement: %checkitem_amount_mat:{3},strict% < 2>'
- 'tell: 已成功出售 所有 {0}, 获得了 %math_{4}*{checkitem_amount_mat:{3},strict}[precision:1]% 金币'
- 'console: minecraft:clear %player_name% {3} %checkitem_amount_mat:{3},strict%'
- 'GIVE-MONEY: %math_{4}*{checkitem_amount_mat:{3},strict}[precision:1]%'
right:
- 'tell: 你身上没有可出售的物品_||_Break:<Requirement: %checkitem_amount_mat:{3},strict% < 1>'
- |-
Catcher:
<Type=CHAT>
<Before=TELL: &c ▪ &b您正在&a&l回收物品&b, 当前物品回收价为&e{4}金币/个&b。;TELL: &f &b请输入需要回收的数量, &f输入 &7cancel &f可取消。>
<Invalid=TELL: &c ▪ &c您的物品不足或输入错误,请输入大于0的数字。>
<Require=TrUtils.isNumber("$input") && TrUtils.isGreater("$input", "0") && "%checkitem_mat:{3},amt:$input%" == "yes">
<Valid=menu: 收购数量确认 {0} {1} $input {3} {4}>
<Cancel=TELL: &7 ▪ 已取消...>
---
# {0} 名字name
# {1} 材料mats
# {2} 英文名字
# {3} 变量材料
# {4} 零售价格
# {5} 材料data
'A':
update: 3
display:
mats: lime stained glass pane
name:
- '&a&l 确认回收 {0}'
lore:
- '&d&l ▪ &a&l预计获得: &e%math_{4}*{2}[precision:1]% 金币 '
actions:
all:
- 'force-close'
- 'give-eco: %math_{4}*{2}[precision:1]%'
- 'console: minecraft:clear %player_name% {3} {2}'
- 'tell: &a ▪ &b您成功回收了 &a{2} &b个物品, 获得了 &e%math_{4}*{2}[precision:1]% 金币&b。'
- 'title: <TITLE=&3&l出售成功><SUBTITLE=&b&l金币已添加至您的账户>'
- 'sound: BLOCK_NOTE_BLOCK_BELL-1-2'
看看有没有帮助
本内容来自 @嘿嘿嘿嘿嘿鹰
# {0} 名字name
# {1} 材料mats
# {2} 英文名字
# {3} 变量材料
# {4} 零售价格
# {5} 材料data
'A':
display:
mats: end_crystal
name: '&e&l收购 {0} &8[&b&l{2}&8]'
lore:
- '&8&l&m '
- '&7拥有数量: &a&l%checkitem_amount_mat:{3}% &7个'
- '&8&l&m '
- '&7收购单价:&a&l {4}&a/个'
- '&8&l&m '
- '&a▶ 点击左键'
- '&7出售 &l1 &7个'
- '&8 '
- '&a▶ 点击右键'
- '&7输入收购数量'
- '&8 '
- '&a▶ SHIFT &7+ &a右键'
- '&7出售 &l全部 [%checkitem_amount_mat:{3}%]'
- '&7预计获得 &e%math_{4}*{checkitem_amount_mat:{3},strict}[precision:1]% 金币'
- '&8&l&m '
actions:
all:
- 'sound: BLOCK_NOTE_BLOCK_PLING-1-2'
left:
- 'tell: 你身上没有可出售的物品_||_Break:<Requirement: %checkitem_amount_mat:{3},strict% < 1>'
- 'tell: 已成功出售 1 个{0}, 获得了 {4} 金币'
- 'console: minecraft:clear %player_name% {3} 1'
- 'GIVE-MONEY:{4}'
shift_right:
- 'tell: 你身上没有可出售的物品_||_Break:<Requirement: %checkitem_amount_mat:{3},strict% < 2>'
- 'tell: 已成功出售 所有 {0}, 获得了 %math_{4}*{checkitem_amount_mat:{3},strict}[precision:1]% 金币'
- 'console: minecraft:clear %player_name% {3} %checkitem_amount_mat:{3},strict%'
- 'GIVE-MONEY: %math_{4}*{checkitem_amount_mat:{3},strict}[precision:1]%'
right:
- 'tell: 你身上没有可出售的物品_||_Break:<Requirement: %checkitem_amount_mat:{3},strict% < 1>'
- |-
Catcher:
<Type=CHAT>
<Before=TELL: &c ▪ &b您正在&a&l回收物品&b, 当前物品回收价为&e{4}金币/个&b。;TELL: &f &b请输入需要回收的数量, &f输入 &7cancel &f可取消。>
<Invalid=TELL: &c ▪ &c您的物品不足或输入错误,请输入大于0的数字。>
<Require=TrUtils.isNumber("$input") && TrUtils.isGreater("$input", "0") && "%checkitem_mat:{3},amt:$input%" == "yes">
<Valid=menu: 收购数量确认 {0} {1} $input {3} {4}>
<Cancel=TELL: &7 ▪ 已取消...>
---
# {0} 名字name
# {1} 材料mats
# {2} 英文名字
# {3} 变量材料
# {4} 零售价格
# {5} 材料data
'A':
update: 3
display:
mats: lime stained glass pane
name:
- '&a&l 确认回收 {0}'
lore:
- '&d&l ▪ &a&l预计获得: &e%math_{4}*{2}[precision:1]% 金币 '
actions:
all:
- 'force-close'
- 'give-eco: %math_{4}*{2}[precision:1]%'
- 'console: minecraft:clear %player_name% {3} {2}'
- 'tell: &a ▪ &b您成功回收了 &a{2} &b个物品, 获得了 &e%math_{4}*{2}[precision:1]% 金币&b。'
- 'title: <TITLE=&3&l出售成功><SUBTITLE=&b&l金币已添加至您的账户>'
- 'sound: BLOCK_NOTE_BLOCK_BELL-1-2'
看看有没有帮助
也不算太难,简单点的,就是检测金币数量,然后设置一次购买的数量,或者用输入捕获来写