Ver código fonte

允许在 state 0 检测奖励物品

LTCatt 6 anos atrás
pai
commit
2cb49fee9b

+ 3 - 3
data/item/functions/tick2.mcfunction

@@ -1,13 +1,13 @@
 
 # 防止玩家丢弃物品:如果物品存在 Thrower 则要求强制捡起
-execute as @e[type=item] if data entity @s Thrower run function item:disable_throw
+execute if score $state mem matches 1.. as @e[type=item] if data entity @s Thrower run function item:disable_throw
 
 # 检查玩家拾取奖励物品
 execute as @a if data entity @s Inventory[{"tag":{"bonus_new":1b}}] run function item:bonus_item/call
 
 # 检测玩家第九格锁定
-execute as @a unless data entity @s Inventory[{Slot:8b,tag:{GameItem:1b}}] unless data entity @s Inventory[{Slot:8b,tag:{LockItem:1b},Count:1b}] run function item:disable_slot
-execute as @a unless data entity @s Inventory[{Slot:8b,tag:{LockItem:1b},Count:1b}] if data entity @s Inventory[{tag:{LockItem:1b},Count:1b}] run clear @s red_dye{LockItem:1b}
+execute if score $state mem matches 1.. as @a unless data entity @s Inventory[{Slot:8b,tag:{GameItem:1b}}] unless data entity @s Inventory[{Slot:8b,tag:{LockItem:1b},Count:1b}] run function item:disable_slot
+execute if score $state mem matches 1.. as @a unless data entity @s Inventory[{Slot:8b,tag:{LockItem:1b},Count:1b}] if data entity @s Inventory[{tag:{LockItem:1b},Count:1b}] run clear @s red_dye{LockItem:1b}
 
 # 清除临时物品
 clear @a red_dye{LockTempItem:1b}

+ 1 - 1
data/ltw/functions/clock/tick2.mcfunction

@@ -2,7 +2,7 @@
 schedule function ltw:clock/tick2 2t replace
 
 # 调用其他模块
-execute if score $state mem matches 1.. run function item:tick2
+function item:tick2
 execute if score $state mem matches 3 run function ltw:state/3/tick2
 execute if score $state mem matches 4 run function ltw:state/4/tick2
 execute if score $state mem matches 5 run function ltw:state/5/tick2