日本免费全黄少妇一区二区三区-高清无码一区二区三区四区-欧美中文字幕日韩在线观看-国产福利诱惑在线网站-国产中文字幕一区在线-亚洲欧美精品日韩一区-久久国产精品国产精品国产-国产精久久久久久一区二区三区-欧美亚洲国产精品久久久久

我的世界1.12版函數(shù)命令系統(tǒng)教學(xué)詳解 函數(shù)命令系統(tǒng)教程( 四 )


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
接下來我們來慢慢分析 。
首先是開始的條件 。有紅藍(lán)兩隊(duì),那么這兩隊(duì)都肯定需要有人,才能夠開始,考慮到同一選擇器中不能重復(fù)使用tag的參數(shù),我們保留了區(qū)分隊(duì)伍的參數(shù),而不是區(qū)分是否準(zhǔn)備就緒的參數(shù) 。因此,第一條指令的意思是,當(dāng)存在選了職業(yè)并選紅隊(duì)的玩家以及選了職業(yè)并選藍(lán)隊(duì)的玩家,我們給中心實(shí)體加上allReady這個(gè)標(biāo)記,以表明可能滿足開始條件 。
至于滿足條件嗎?如果有未準(zhǔn)備就緒的玩家,就說明不滿足,那我們就讓一個(gè)沒有準(zhǔn)備就緒的玩家來去掉allReady這個(gè)標(biāo)記好了 。
對(duì)于3~5行,我們放后面點(diǎn)講 。先看后面 。滿足開始條件以后,我們會(huì)給中心實(shí)體加分(使用waitTime這個(gè)記分板項(xiàng)),在第一刻加分后出現(xiàn)提示文字提示準(zhǔn)備開始,然后進(jìn)入循環(huán)計(jì)時(shí),最后計(jì)時(shí)滿了,調(diào)用system:startgame這個(gè)函數(shù)來開始游戲(這里不是例子的部分,不作說明) 。
那么回過頭來看3~5行,這里明顯是打斷的部分 。打斷,就是要清掉提示文字、重置計(jì)時(shí)器 。如果此時(shí)都還沒有進(jìn)行過加分,那么我們就不必進(jìn)行那三條指令,因此可以看到中間有個(gè)選擇器里有score_waitTime_min=1的參數(shù)加以限制 。
重點(diǎn)來了,我們看到這3條指令前面相當(dāng)長(zhǎng)一串execute是重復(fù)的 。因?yàn)樵谝郧坝胏b寫的時(shí)候,這里我使用了Conditional,而現(xiàn)在函數(shù)不直接支持Conditional,所以我用了一大堆execute,但是這里我們可以稍作修改,對(duì)不對(duì)?請(qǐng)看下面
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":"請(qǐng)玩家站在準(zhǔn)備區(qū)域不要離開"}]
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"}]

推薦閱讀