[MCBE]雪球枪<弹夹系统>

指令楼
第一部分
execute @e[name=§l§e弹夹] ~~~ tag @p add q
replaceitem entity @a[tag=q] slot.hotbar 0 iron_nugget 30 0 {"minecraft:item_lock":{"mode":"lock_in_slot"}}
execute @a[hasitem={item=iron_nugget,quantity=0}] ~~~ tag @p remove q
kill @e[name=§l§e弹夹]
第二部分
replaceitem entity @a[tag=!q] slot.hotbar 0 barrier 1 0 {"minecraft:item_lock":{"mode":"lock_in_slot"}}