check_slot.mcfunction 888 B

12345678910
  1. # 第八格
  2. execute unless data entity @s Inventory[{Slot:7b,tag:{game_item:1b}}] unless data entity @s Inventory[{Slot:7b,tag:{LockItem:1b,LockSlot:7b},Count:1b}] run function item:disable_slot/disable_slot_7
  3. execute unless data entity @s Inventory[{Slot:7b,tag:{LockItem:1b,LockSlot:7b},Count:1b}] if data entity @s Inventory[{tag:{LockItem:1b,LockSlot:7b},Count:1b}] run clear @s barrier{LockItem:1b,LockSlot:7b}
  4. # 第九格
  5. execute unless data entity @s Inventory[{Slot:8b,tag:{game_item:1b}}] unless data entity @s Inventory[{Slot:8b,tag:{LockItem:1b,LockSlot:8b},Count:1b}] run function item:disable_slot/disable_slot_8
  6. execute unless data entity @s Inventory[{Slot:8b,tag:{LockItem:1b,LockSlot:8b},Count:1b}] if data entity @s Inventory[{tag:{LockItem:1b,LockSlot:8b},Count:1b}] run clear @s barrier{LockItem:1b,LockSlot:8b}
  7. # 清除临时物品
  8. clear @a barrier{LockTempItem:1b}