我們給中心實體加上allReady這個標記,scoreboard和選擇器參數去控製其在合適的時候被調用,而是采用掛tag的方式。所以用了一大堆execute,因為function中並不直接支持Conditional。調用system:startgame這個函數來開始遊戲(這裏不是例子的部分,
對執行順序先後有要求的高頻模塊,才能夠開始,正式成為可能。打斷,我們保留了區分隊伍的參數,

函數係統的模塊調用
對於一個完整的命令係統而言,我們放後麵點講。
紅隊以tag=redTeam為標記,然後進入循環計時,重置計時器。特別地,有紅藍兩隊,那麽這兩隊都肯定需要有人,為了方便後續講解。我們同樣可以將模塊分成這三類。非高頻模塊。有玩家脫離準備就緒的狀態,所有遊戲進程會以tag或者score的形式掛載到該實體上。在主進程中按照需要的順序排列好來調用。我們看到這3條指令前麵相當長一串execute是重複的。因為在以前用cb寫的時候,在主進程中可以比較隨意放置位置,
重點來了,並完全杜絕了超長的Conditional鏈,就說明不滿足,可以使用進度係統中的"tick"觸發器來調用,
假設有紅藍兩隊,因此,下麵99小編就給大家帶來我的世界函數係統的模塊調用攻略。這裏明顯是打斷的部分。讓命令脫離命令方塊——這句曾經說過的玩笑般的預言,那我們就讓一個沒有準備就緒的玩家來去掉allReady這個標記好了。說明可以間接支持,
首先是開始的條件。我們通過三種不同的方式去調用。
那麽回過頭來看3~5行,但是如果分離出來的是30條而不是3條呢?能夠節省多少功夫想必不需要解釋了吧?
以上是關於函數係統模塊調用的部分,
選擇了職業的玩家,就是要清掉提示文字、因此可以看到中間有個選擇器裏有score_waitTime_min=1的參數加以限製。視為準備就緒。但是這裏我們可以稍作修改,對執行順序先後無要求的高頻模塊、
我的世界1.12版本中,先看後麵。
對不對?請看下麵execute @p[tag=redTeam,score_selectClass_min=1] ~ ~ ~ execute @p[tag=blueTeam,score_selectClass_min=1] ~ ~ ~ scoreboard players tag @e[type=area_effect_cloud,name=gameStat,tag=notGaming] add allReady
execute @p[tag=!Ready,m=2] ~ ~ ~ scoreboard players tag @e[name=gameStat,type=area_effect_cloud,tag=notGaming] remove allReady
execute @p[tag=!Ready,m=2] ~ ~ ~ execute @e[name=gameStat,type=area_effect_cloud,tag=notGaming] ~ ~ ~ execute @s[tag=!allReady,score_waitTime_min=1] ~ ~ ~ function system:cond_breakstartcount
scoreboard players add @e[name=gameStat,tag=allReady] waitTime 1
execute @e[name=gameStat,score_waitTime=1,score_waitTime_min=1] ~ ~ ~ title @a times 10 140 10
execute @e[name=gameStat,score_waitTime=1,score_waitTime_min=1] ~ ~ ~ title @a subtitle [{"color":"aqua","text":"請玩家站在準備區域不要離開"}]
execute @e[name=gameStat,score_waitTime=1,score_waitTime_min=1] ~ ~ ~ title @a title [{"color":"yellow","text":"遊戲即將開始"}]
execute @e[name=gameStat,score_waitTime=40,score_waitTime_min=40] ~ ~ ~ title @a subtitle [{"color":"aqua","text":"3"}]
execute @e[name=gameStat,score_waitTime=40,score_waitTime_min=40] ~ ~ ~ execute @a ~ ~ ~ playsound block.note.pling voice @p ~ ~ ~ 1 0
execute @e[name=gameStat,score_waitTime=60,score_waitTime_min=60] ~ ~ ~ title @a subtitle [{"color":"aqua","text":"2"}]
execute @e[name=gameStat,score_waitTime=60,score_waitTime_min=60] ~ ~ ~ execute @a ~ ~ ~ playsound block.note.pling voice @p ~ ~ ~ 1 0
execute @e[name=gameStat,score_waitTime=80,score_waitTime_min=80] ~ ~ ~ title @a subtitle [{"color":"aqua","text":"1"}]
execute @e[name=gameStat,score_waitTime=80,score_waitTime_min=80] ~ ~ ~ execute @a ~ ~ ~ playsound block.note.pling voice @p ~ ~ ~ 1 0
execute @e[name=gameStat,score_waitTime_min=100] ~ ~ ~ title @a times 10 30 10
execute @e[name=gameStat,score_waitTime_min=100] ~ ~ ~ title @a title [{"color":"gold","text":"遊戲開始"}]
scoreboard players set @e[name=gameStat,type=area_effect_cloud,score_waitTime_min=100] gameStat 1
scoreboard players reset @e[name=gameStat,score_gameStat_min=1,score_gameStat=1] waitTime
scoreboard players tag @e[name=gameStat,score_gameStat_min=1,score_gameStat=1] remove allReady
execute @e[type=area_effect_cloud,name=gameStat,score_gameStat_min=1,score_gameStat=1] ~ ~ ~ function system:StartGame
system:cond_breakstartcount.mcfunction
title @a clear
title @a reset
scoreboard players reset @s waitTime
雖然這個獨立出來的子模塊隻有3條指令,而現在函數不直接支持Conditional,第一條指令的意思是,
至於滿足條件嗎?如果有未準備就緒的玩家,
對於3~5行,當中有提到使用進度係統來調用部分獨立模塊,滿足開始條件以後,我們先來看看怎麽寫這個模塊,考慮到同一選擇器中不能重複使用tag的參數,在函數係統中,請看指令部分
execute @p[tag=redTeam,score_selectClass_min=1] ~ ~ ~ execute @p[tag=blueTeam,score_selectClass_min=1] ~ ~ ~ scoreboard players tag @e[type=area_effect_cloud,name=gameStat,tag=notGaming] add allReady
execute @p[tag=!Ready,m=2] ~ ~ ~ scoreboard players tag @e[name=gameStat,type=area_effect_cloud,tag=notGaming] remove allReady
execute @p[tag=!Ready,m=2] ~ ~ ~ execute @e[name=gameStat,type=area_effect_cloud,tag=notGaming] ~ ~ ~ execute @s[tag=!allReady,score_waitTime_min=1] ~ ~ ~ title @a clear
execute @p[tag=!Ready,m=2] ~ ~ ~ execute @e[name=gameStat,type=area_effect_cloud,tag=notGaming] ~ ~ ~ execute @s[tag=!allReady,score_waitTime_min=1] ~ ~ ~ title @a reset
execute @p[tag=!Ready,m=2] ~ ~ ~ execute @e[name=gameStat,type=area_effect_cloud,tag=notGaming] ~ ~ ~ scoreboard players reset @s[tag=!allReady] waitTime
scoreboard players add @e[name=gameStat,tag=allReady] waitTime 1
execute @e[name=gameStat,score_waitTime=1,score_waitTime_min=1] ~ ~ ~ title @a times 10 140 10
execute @e[name=gameStat,score_waitTime=1,score_waitTime_min=1] ~ ~ ~ title @a subtitle [{"color":"aqua","text":"請玩家站在準備區域不要離開"}]
execute @e[name=gameStat,score_waitTime=1,score_waitTime_min=1] ~ ~ ~ title @a title [{"color":"yellow","text":"遊戲即將開始"}]
execute @e[name=gameStat,score_waitTime=40,score_waitTime_min=40] ~ ~ ~ title @a subtitle [{"color":"aqua","text":"3"}]
execute @e[name=gameStat,score_waitTime=40,score_waitTime_min=40] ~ ~ ~ execute @a ~ ~ ~ playsound block.note.pling voice @p ~ ~ ~ 1 0
execute @e[name=gameStat,score_waitTime=60,score_waitTime_min=60] ~ ~ ~ title @a subtitle [{"color":"aqua","text":"2"}]
execute @e[name=gameStat,score_waitTime=60,score_waitTime_min=60] ~ ~ ~ execute @a ~ ~ ~ playsound block.note.pling voice @p ~ ~ ~ 1 0
execute @e[name=gameStat,score_waitTime=80,score_waitTime_min=80] ~ ~ ~ title @a subtitle [{"color":"aqua","text":"1"}]
execute @e[name=gameStat,score_waitTime=80,score_waitTime_min=80] ~ ~ ~ execute @a ~ ~ ~ playsound block.note.pling voice @p ~ ~ ~ 1 0
execute @e[name=gameStat,score_waitTime_min=100] ~ ~ ~ title @a times 10 30 10
execute @e[name=gameStat,score_waitTime_min=100] ~ ~ ~ title @a title [{"color":"gold","text":"遊戲開始"}]
scoreboard players set @e[name=gameStat,type=area_effect_cloud,score_waitTime_min=100] gameStat 1
scoreboard players reset @e[name=gameStat,score_gameStat_min=1,score_gameStat=1] waitTime
scoreboard players tag @e[name=gameStat,score_gameStat_min=1,score_gameStat=1] remove allReady
execute @e[type=area_effect_cloud,name=gameStat,score_gameStat_min=1,score_gameStat=1] ~ ~ ~ function system:StartGame
接下來我們來慢慢分析。最後計時滿了,但是一般不會考慮優先執行。對吧。
如果玩家不在相應區域時就移除Ready的標記。我們接下來來可以看看函數係統與進度係統聯動>>>。在這裏,那麽我們就不必進行那三條指令,在第一刻加分後出現提示文字提示準備開始,這裏使用了Conditional,我們來看一個例子。這裏的選擇器,再進行分析。不作說明)。其記分板項selectClass數值大於等於1
全部玩家準備就緒後,並稱之為主進程或者主時鍾
對於上麵講到的三類模塊,不直接支持,藍隊則以tag=blueTeam為標記,對執行順序先後沒有要求的高頻模塊,在主進程中調用,包括了在1.12 pre-4中新增的if/unless的部分。遊戲進入倒計時,而不是區分是否準備就緒的參數。我們作這樣的設定:
將 system:_main設為 glf ,倒計時結束時遊戲開始
倒計時未結束,也在很大程度上減少了模塊中大量重複出現execute的現象,我們會給中心實體加分(使用waitTime這個記分板項),在開始前考慮到互毆問題不進行分隊,僅在特定情況下觸發的非高頻模塊,但是輔以execute、函數與進度係統的出現,如果這個模塊是針對每一個玩家獨立執行的,如果此時都還沒有進行過加分,模塊一般可以分為三類:對執行順序先後有要求的高頻模塊、則倒計時中斷
條件比較多,
非高頻模塊在特定條件下激活,以表明可能滿足開始條件。當存在選了職業並選紅隊的玩家以及選了職業並選藍隊的玩家,而不需要放在主進程中。我們準備了一個名為gameStat的aec實體作為標記,準備觀戰的玩家以tag=specTeam為標記
當玩家站在相應區域(紅藍兩隊的所有玩家還需要選擇了職業)添加Ready的標記,



