[MCBE] 二次点击式快捷栏菜单教程!!!

前置指令
1.scoreboard objectives add 物品栏菜单 dummy
2.scoreboard players add @a 物品栏菜单 0
命令方块循环保持无条件开启
主要部分
1.execute @a[tag=登录主城,scores={物品栏菜单=0}]
2.execute @a[tag=登录主城,hasitem={item=cake,location=slot.weapon.mainhand,data=0,quantity=1,slot=0},scores={物品栏菜单=!1}] ~~~ title @s actionbar §6§l单机§d游戏 §r◁点击空格后再次点击执行
§7Click Excute again
循环无条件保持开启
3.execute @a[tag=登录主城,hasitem={item=cake,location=slot.weapon.mainhand,data=0,quantity=1,slot=0}] ~~~ scoreboard players set @s 物品栏菜单 1
连锁无条件保持开启
4.execute @a[tag=登录主持,hasitem={item=cake,location=slot.weapon.mainhand,data=0,quantity=0,slot=0},scores={物品栏菜单=1}] ~~~ scoreboard players set @s 物品栏菜单 2
5.execute @a[tag=登录主城,scores={物品栏菜单=2}] replaceitem entity @s slot.hotbar 1 cake 1 1 {"minecraft:item_lock":{"mode":"lock_in_slot"}]
循环无条件
6.execute @a[tag=登录主城,hasitem={item=cake,location=slot.weapon.mainhand,data=1,quantity=1,slot=0},scores={物品栏菜单=2}] ~~~ scoreboard players set @s 物品栏菜单 3
连锁无条件
7.execute @a[scores={物品栏菜单=3}] ~~~ scoreboard players set @s 物品栏菜单 0
连锁无条件
8.execute @a[scores={物品栏菜单=3}] ~~~ 任意指令
提示:tag可以去掉,物品id自改,命令方块摆放请按照视频摆放