作為一個開了3年的無mod服務(wù)器的老玩家,想在服務(wù)器里增加一點樂趣,就需要用到命令方塊
我的世界版本1.8.19(對應(yīng)網(wǎng)易版2.8.5.23)后續(xù)版本可能有改動
首先來看看單個的指令如圖:

通過這些指令我們可以來完成一些有趣的東西
1.雪球菜單 2.抽獎機器 3.商店 4.幸運方塊 5.技能 6.自定義傳送 7.懸賞系統(tǒng) 8.任務(wù)系統(tǒng)等等
首先講解最新的雪球菜單指令,分為三個部分:扔雪球選擇,顯示內(nèi)容,確認
扔雪球選擇指令如下(講解):
execute @e[type=snowball] ~~~ scoreboard players add @p[r=2] 雪球菜單 1
如上指令,給予附近扔的玩家,記分板“雪球菜單”增加1分
execute @e[type=snowball] ~~~ playsound random.orb @p[r=2]
如上指令,每扔一下發(fā)出一聲音
execute @a[scores={雪球菜單=1..}] ~~~ kill @e[type=snowball,r=4]
如上指令,將積分板為大于1的玩家,清除附近雪球
execute @a[scores={雪球菜單=7}] ~~~ scoreboard players set @s 雪球菜單 1
如上指令,這個是將積分板為7的玩家,設(shè)置成記分板1,已實現(xiàn)循環(huán)
接下來是顯示部分:
這個內(nèi)容很長,不容易理解,涉及到text文本的顏色,換行,記分顯示,其中§是表示選擇的顏色[后面可加1~10等還可以用字母表示特殊顏色。“\n”代表換行。scores后面表示記分板,用scores={記分板=數(shù)值范圍}來表示
execute @a[scores={雪球菜單=1..6}] ~~~ titleraw @s actionbar {"rawtext":[{"text":"§l§b??滿頭問號??\n==================§e\n"},{"translate":"%%2","with":{"rawtext":[{"selector":"@s[scores={雪球菜單=1}]"},{"text":"? §6},{"text":"? ? §e"}]}},{"text":"返回主城\n"},{"translate":"%%2","with":{"rawtext":[{"selector":"@s[scores={雪球菜單=2}]"},{"text":"? §6},{"text":"? ? §e"}]}},{"text":"????\n"},{"translate":"%%2","with":{"rawtext":[{"selector":"@s[scores={雪球菜單=3}]"},{"text":"? §6},{"text":"? ? §e"}]}},{"text":"???\n"},{"translate":"%%2","with":{"rawtext":[{"selector":"@s[scores={雪球菜單=4}]"},{"text":"? §6},{"text":"? ? §e"}]}},{"text":"??????\n"},{"translate":"%%2","with":{"rawtext":[{"selector":"@s[scores={雪球菜單=5}]"},{"text":"? §6},{"text":"? ? §e"}]}},{"text":"????\n"},{"translate":"%%2","with":{"rawtext":[{"selector":"@s[scores={雪球菜單=6}]"},{"text":"? §6},{"text":"? ? §e"}]}},{"text":"??\n"},{"text":"§a抬頭確定 §c低頭取消?\n\n\n\n"}]}
之后是確認部分:確認和取消通過,玩家抬頭低頭確認在命令中用rx,rxm來表示
execute @a[scores={雪球菜單=1},rx=-85] ~~~ title @s title §l§b回城成功!
如上指令,記分板為1,抬頭的玩家顯示顯示回城成功
execute @a[scores={雪球菜單=1},rx=-85] ~~~ tp @s -51 119 -2
如上指令,給記分板為1,抬頭的玩家傳送到-51 119 -2位置
execute @a[scores={雪球菜單=1..4},rx=-85] ~~~ scoreboard players set @s 雪球菜單 0
如上指令,給記分板1到4(為什么是1~4,因為只要確認了就會抬頭,是一種包含的關(guān)系),抬頭的玩家,將記分板變?yōu)?(為什么是-85而不是-90,-90這個數(shù)值在版本中有失靈的可能)
execute @a[scores={雪球菜單=!0},rxm=88] ~~~ title @s actionbar §l§c已關(guān)閉菜單?
如上指令,給記分板不等于(用!表示)0的玩家,低頭顯示“關(guān)閉菜單”字符
execute @a[scores={雪球菜單=!0},rxm=88] ~~~ scoreboard players set @s 雪球菜單 0
如上指令,給記分板不等于(用!表示)0的玩家,將記分板設(shè)置為0
execute @a[scores={雪球菜單=!0},rxm=88] ~~~ playsound fire.ignite @p
如上指令,給記分板不等于(用!表示)0的玩家,低頭的玩家,播放聲音
這就是雪球菜單的指令部分
其余的小裝置后續(xù)待更新