網(wǎng)易我的世界 純指令雪球菜單式計算器
指令計算器
創(chuàng)建計分板
/scoreboard objectives add number1 dummy "數(shù)字1"
/scoreboard objectives add number2 dummy "數(shù)字2"
/scoreboard objectives add cd dummy "菜單"
/scoreboard objectives add final dummy "顯示結果"
/scoreboard objectives add result dummy "運算結果"
/scoreboard objectives add add dummy "加分"
/scoreboard objectives add tx dummy "運算符號"
/scoreboard objectives add remain dummy "余數(shù)"
計算器頁面
execute @a[scores={cd=1..}] ~~~ titleraw @s actionbar {"rawtext":[{"text":"計算器(整數(shù))\n\n"},{"score":{"objective":"number1","name":"@s"}},{"translate":"%%5","with":{"rawtext":[{"selector":"@s[scores={tx=1}]"},{"selector":"@s[scores={tx=1..2}]"},{"selector":"@s[scores={tx=1..3}]"},{"selector":"@s[scores={tx=1..4}]"},{"text":"+"},{"text":"-"},{"text":"x"},{"text":"÷"},{"text":""}]}},{"score":{"objective":"number2","name":"@s"}},{"translate":"%%2","with":{"rawtext":[{"selector":"@s[scores={result=1}]"},{"text":"="},{"text":""}]}},{"score":{"objective":"final","name":"@s"}},{"translate":"%%2","with":{"rawtext":[{"selector":"@s[scores={tx=4}]"},{"rawtext":[{"text":".."},{"score":{"objective":"remain","name":"@s"}}]},{"text":""}]}},{"text":"\n"},{"translate":"%%2","with":{"rawtext":[{"selector":"@s[scores={cd=11}]"},{"text":"§b"},{"text":"§7"}]}},{"text":"\n1"},{"text":"? ?"},{"translate":"%%2","with":{"rawtext":[{"selector":"@s[scores={cd=12}]"},{"text":"§b"},{"text":"§7"}]}},{"text":"2"},{"text":"? ?"},{"translate":"%%2","with":{"rawtext":[{"selector":"@s[scores={cd=13}]"},{"text":"§b"},{"text":"§7"}]}},{"text":"3"},{"text":" "},{"translate":"%%2","with":{"rawtext":[{"selector":"@s[scores={cd=21}]"},{"text":"§b"},{"text":"§7"}]}},{"text":" +"},{"text":" "},{"translate":"%%2","with":{"rawtext":[{"selector":"@s[scores={cd=22}]"},{"text":"§b"},{"text":"§7"}]}},{"text":"-"},{"text":" "},{"translate":"%%2","with":{"rawtext":[{"selector":"@s[scores={cd=14}]"},{"text":"§b"},{"text":"§7"}]}},{"text":"\n4"},{"text":"? ?"},{"translate":"%%2","with":{"rawtext":[{"selector":"@s[scores={cd=15}]"},{"text":"§b"},{"text":"§7"}]}},{"text":"5"},{"text":"? ?"},{"translate":"%%2","with":{"rawtext":[{"selector":"@s[scores={cd=16}]"},{"text":"§b"},{"text":"§7"}]}},{"text":"6"},{"text":" "},{"translate":"%%2","with":{"rawtext":[{"selector":"@s[scores={cd=23}]"},{"text":"§b"},{"text":"§7"}]}},{"text":" x"},{"text":" "},{"translate":"%%2","with":{"rawtext":[{"selector":"@s[scores={cd=24}]"},{"text":"§b"},{"text":"§7"}]}},{"text":"÷"},{"text":" "},{"translate":"%%2","with":{"rawtext":[{"selector":"@s[scores={cd=17}]"},{"text":"§b"},{"text":"§7"}]}},{"text":"\n7"},{"text":"? ?"},{"translate":"%%2","with":{"rawtext":[{"selector":"@s[scores={cd=18}]"},{"text":"§b"},{"text":"§7"}]}},{"text":"8"},{"text":"? ?"},{"translate":"%%2","with":{"rawtext":[{"selector":"@s[scores={cd=19}]"},{"text":"§b"},{"text":"§7"}]}},{"text":"9"},{"text":" "},{"translate":"%%2","with":{"rawtext":[{"selector":"@s[scores={cd=25}]"},{"text":"§b"},{"text":"§7"}]}},{"text":"\nC"},{"text":"? ?"},{"translate":"%%2","with":{"rawtext":[{"selector":"@s[scores={cd=20}]"},{"text":"§b"},{"text":"§7"}]}},{"text":"0"},{"text":"? ?"},{"translate":"%%2","with":{"rawtext":[{"selector":"@s[scores={cd=26}]"},{"text":"§b"},{"text":"§7"}]}},{"text":"="},{"text":"\n\n§f §b["},{"translate":"%%7","with":{"rawtext":[{"selector":"@s[scores={add=1}]"},{"selector":"@s[scores={add=1..2}]"},{"selector":"@s[scores={add=1..3}]"},{"selector":"@s[scores={add=1..4}]"},{"selector":"@s[scores={add=1..5}]"},{"selector":"@s[scores={add=1..6}]"},{"text":"§c"},{"text":"§6"},{"text":"§e"},{"text":"§a"},{"text":"§3"},{"text":"§b"},{"text":"§d"}]}},{"text":"FanTana"},{"text":"§b] §a出品\n\n\n\n\n"}]}
切換分數(shù)
execute @a[scores={number1=!0,number2=!0,cd=!26},hasitem={item=snowball,location=slot.weapon.mainhand,quantity=0}] ~~~ scoreboard players set @s cd 26
功能部分
execute? @e[type=snowball] ~~~ scoreboard players add @p cd 1
kill @e[type=snowball]
execute @a[scores={cd=!0},rxm=88] ~~~ title @s actionbar .
execute @a[scores={cd=!0},rxm=88] ~~~ scoreboard players reset @s number1
execute @a[scores={cd=!0},rxm=88] ~~~ scoreboard players reset @s number2
execute @a[scores={cd=!0},rxm=88] ~~~ scoreboard players reset @s enter
execute @a[scores={cd=!0},rxm=88] ~~~ scoreboard players reset @s tx
execute @a[scores={cd=!0},rxm=88] ~~~ scoreboard players reset @s final
execute @a[scores={cd=!0},rxm=88] ~~~ scoreboard players reset @s result
execute @a[scores={cd=!0},rxm=88] ~~~ scoreboard players reset @s remain
execute @a[scores={cd=!0},rxm=88] ~~~ scoreboard players set @s cd 0
scoreboard players set 十 number1 10
scoreboard players set 減數(shù) number1 10
scoreboard players set 二十 tx 20
execute @a[scores={cd=11..19,enter=0},rx=-85] ~~~ scoreboard players operation @s number1 *= 十 number1
execute @a[scores={cd=11..19,enter=0},rx=-85] ~~~ scoreboard players operation @s number1 -= 減數(shù) number1
execute @a[scores={cd=11..19,enter=0},rx=-85] ~~~ scoreboard players operation @s number1 += @s cd
execute @a[scores={cd=20,enter=0},rx=-85] ~~~ scoreboard players operation @s number1 *= 十 number1
execute @a[scores={cd=11..19,enter=1},rx=-85] ~~~ scoreboard players operation @s number2 *= 十 number1
execute @a[scores={cd=11..19,enter=1},rx=-85] ~~~ scoreboard players operation @s number2 -= 減數(shù) number1
execute @a[scores={cd=11..19,enter=1},rx=-85] ~~~ scoreboard players operation @s number2 += @s cd
execute @a[scores={cd=20,enter=1},rx=-85] ~~~ scoreboard players operation @s number2 *= 十 number1
execute @a[scores={cd=21..24},rx=-85] ~~~ scoreboard players operation @s tx = @s cd?
execute @a[scores={cd=21..24},rx=-85] ~~~ scoreboard players operation @s tx -= 二十 tx
execute @a[scores={cd=21..24},rx=-85] ~~~ scoreboard players set @s enter 1
execute @a[scores={cd=26},rx=-85] ~~~ scoreboard players set @s result 1
execute @a[scores={cd=26,tx=1..4},rx=-85] ~~~ scoreboard players operation @s final = @s number1
execute @a[scores={cd=26,tx=1},rx=-85] ~~~ scoreboard players operation @s final += @s number2?
execute @a[scores={cd=26,tx=2},rx=-85] ~~~ scoreboard players operation @s final -= @s number2?
execute @a[scores={cd=26,tx=3},rx=-85] ~~~ scoreboard players operation @s final *= @s number2?
execute @a[scores={cd=26,tx=4},rx=-85] ~~~ scoreboard players operation @s final /= @s number2?
execute @a[scores={cd=26,tx=4},rx=-85] ~~~ scoreboard players operation @s remain = @s number1
execute @a[scores={cd=26,tx=4},rx=-85] ~~~ scoreboard players operation @s remain %= @s number2
execute @a[scores={cd=25},rx=-85] ~~~ scoreboard players reset @s enter
execute @a[scores={cd=25},rx=-85] ~~~ scoreboard players reset @s number1
execute @a[scores={cd=25},rx=-85] ~~~ scoreboard players reset @s number2
execute @a[scores={cd=25},rx=-85] ~~~ scoreboard players reset @s tx
execute @a[scores={cd=25},rx=-85] ~~~ scoreboard players reset @s final
execute @a[scores={cd=25},rx=-85] ~~~ scoreboard players reset @s result
execute @a[scores={cd=25},rx=-85] ~~~ scoreboard players reset @s remain
execute @a[scores={cd=11..26},rx=-85] ~~~ scoreboard players set @s cd 10