[MCBE](水) 指令教程:生物破壞優(yōu)化


注:本文適用于BE1.18.50-(包括網(wǎng)易)
1鏈 綠鏈(負(fù)責(zé)凋靈延遲爆炸處理):
/scoreboard players test Anti-Mobgriefing A 1001 1001
{綠1} RU
/execute @e[type=wither] ~~~ setblock [坐標(biāo):X Y Z 填入{綠3}的坐標(biāo)] chain_command_block 0
{綠2} RC
/setblock ~~~ chain_command_block [{綠3}指向{綠4}的方向參數(shù)]
{綠3} CU
/scoreboard players set Anti-Mobgriefing A -1
{綠4} CU
/scoreboard players set Anti-Mobgriefing A 0
{綠5} CU 201t
--------------------分界線--------------------
2鏈 藍鏈(負(fù)責(zé)正常情況處理):
/scoreboard players test Anti-Mobgriefing A 0 1000
{藍1} RU
/scoreboard players set Anti-Mobgriefing A 0
{藍2} RC
///自定義規(guī)則區(qū) 可增添規(guī)則
/execute @e[type=player] ~~~ execute @e[type=creeper,r=7] ~~~ scoreboard players set Anti-Mobgriefing A 1
{藍3} CU
/execute @e[type=player] ~~~ execute @e[type=fireball,r=16] ~~~ scoreboard players set Anti-Mobgriefing A 2
{藍4} CU
///自定義規(guī)則區(qū)結(jié)束
/execute @e[type=wither] ~~~ scoreboard players set Anti-Mobgriefing A 1001
{藍5} CU
/scoreboard players test Anti-Mobgriefing A 1 1001
{藍6} CU
/setblock [坐標(biāo):X Y Z 填入{藍5}的坐標(biāo)] chain_command_block [{藍5}指向{藍9}的方向參數(shù)]
{藍7} CC
/gamerule mobgriefing false
{藍8} CC
/scoreboard players test Anti-Mobgriefing A 0 0
{藍9} CU
/setblock?[坐標(biāo):X Y Z 填入{藍5}的坐標(biāo)] chain_command_block [{藍5}指向{藍6}的方向參數(shù)]
{藍10} CC
/gamerule mobgriefing true
{藍11} CC
--------------------分界線--------------------
3鏈 紅鏈(tellraw提示,選填):
/tellraw @a {"rawtext":[{"text":"§aMobgriefing on"}]}
{紅1} CC
/tellraw @a {"rawtext":[{"text":"§cMobgriefing off"}]}
{紅2} CC
--------------------分界線--------------------
使用原版標(biāo)準(zhǔn)縮寫:
第一位:
C(Chain)--鏈
R(Repeat)--重復(fù)
第二位:
C(Conditional)--有條件的
U(Unconditional)--無條件的
第三位:
nt(n ticks)--指延遲,本文中延遲不可修改。不寫的規(guī)定為0t。