【MCBE】箱子上鎖系統(tǒng) 上鎖+解鎖 多人可用

MCBE箱子上鎖
指令供參考(我把指令分成三部分,可以像視頻中一樣分三段輸入,無特殊說明默認(rèn)鏈,無條件,保持開啟):
一.箱子上鎖(8)
(循環(huán))/execute @e[type=armor_stand,name=上鎖] ~~~ detect ~~~ chest 2 tag @s add 上鎖
/execute @e[type=armor_stand,name=上鎖] ~~~ detect ~~~ chest 3 tag @s add 上鎖
/execute @e[type=armor_stand,name=上鎖] ~~~ detect ~~~ chest 4 tag @s add 上鎖
/execute @e[type=armor_stand,name=上鎖] ~~~ detect ~~~ chest 5 tag @s add 上鎖
/execute @e[type=armor_stand,tag=上鎖] ~~~ summon donkey ~~-1~ ageable_grow_up 鎖
(有條件)/execute @e[type=armor_stand,tag=上鎖] ~~~ tag @e[type=donkey,name=鎖,r=1] add 鎖
(有條件)/execute @e[type=armor_stand,tag=上鎖] ~~~ tp @e[type=donkey,name=鎖,r=1] ~~-1~
/kill @e[type=armor_stand,tag=上鎖]
二.箱子解鎖(7)
(循環(huán))/replaceitem entity @e[type=donkey,tag=鎖] slot.armor.head 0 keep leather_helmet 1 999
(有條件)/stopsound @a mob.horse.donkey.hit
(有條件)/execute @e[type=donkey,tag=鎖,hasitem={item=leather_helmet}] ~~~ title @p actionbar 箱子已上鎖!
(有條件)/execute @e[type=donkey,tag=鎖,hasitem={item=leather_helmet}] ~~~ execute @p ~~~ title @s[hasitem={item=tripwire_hook,location=slot.weapon.mainhand}] actionbar 箱子已解鎖
(有條件)/execute @e[type=donkey,tag=鎖,hasitem={item=leather_helmet}] ~~~ execute @p ~~~ clear @s[hasitem={item=tripwire_hook,location=slot.weapon.mainhand}] tripwire_hook 0 1
(有條件)/kill @e[type=donkey,tag=鎖,hasitem={item=leather_helmet}]
/replaceitem entity @e[type=donkey,tag=鎖] slot.armor.head 0 iron_helmet 1 999
三.其它效果(3)
/execute @e[type=donkey,tag=鎖] ~~~ tp @s
/effect @e[type=donkey,tag=鎖] invisibility 1 0 true
/effect @e[type=donkey,tag=鎖] resistance 1 255 true
最后請?jiān)偌右粋€(gè)循環(huán)命令方塊:
/execute @e[type=donkey,tag=鎖] ~~~ detect ~~0.1~ air 0 tp ~~-1~
否則退出重進(jìn)時(shí)會出現(xiàn)驢在箱子上面的bug,十分抱歉
以上指令是直接從存檔里復(fù)制的,用的是網(wǎng)易,基巖版也通用,但是舊語法
如果有問題歡迎私信我