tick2.mcfunction 1.6 KB

12345678910111213141516171819202122232425262728
  1. # 防止玩家丢弃物品:如果物品存在 Thrower 则要求强制捡起
  2. execute as @e[type=item] if data entity @s Thrower run function item:disable_throw
  3. # 检查玩家拾取奖励物品
  4. execute as @a if data entity @s Inventory[{"tag":{"bonus_new":1b}}] run function item:bonus_item/call
  5. # 检测玩家格子锁定
  6. execute if score $state mem matches 1.. unless score $survival mem matches 1 as @a[team=!debugging] run function item:disable_slot/check_slot
  7. execute if score $state mem matches 0 as @a run function ltw:state/0/state/check_slot
  8. execute if score $state mem matches 0.. run kill @e[type=item,tag=LockTempItem]
  9. # 检查购买物品
  10. execute as @a run function item:shop/check
  11. # 物品特效
  12. execute as @e[tag=item_green] at @s run particle minecraft:glow ~ ~0.3 ~ 0.5 0.5 0.5 0 1 normal
  13. execute as @e[tag=item_blue] at @s run particle minecraft:dragon_breath ~ ~0.3 ~ 0.7 0.7 0.7 0.01 1 normal
  14. execute as @e[tag=item_blue] at @s run particle minecraft:dragon_breath ~ ~0.3 ~ 1.3 1.3 1.3 0.01 1 normal
  15. execute as @e[tag=item_purple] at @s run particle minecraft:wax_on ~ ~0.3 ~ 0 0 0 6 1 normal
  16. execute as @e[tag=item_purple] at @s run particle minecraft:wax_on ~ ~0.3 ~ 0.7 0.7 0.7 1 1 normal
  17. execute as @e[tag=item_purple] at @s run particle minecraft:wax_on ~ ~0.3 ~ 1.5 1.5 1.5 1 2 normal
  18. execute as @e[tag=item_purple] at @s run particle minecraft:wax_on ~ ~0.3 ~ 2.5 2.5 2.5 1 1 normal
  19. # 禁止捡起、在落地 10 秒后清理
  20. execute as @e[type=arrow,tag=!projectile_checked] run data merge entity @s {pickup:0,life:1000,Tags:["projectile_checked"]}
  21. # 调用粒子模块
  22. function item:particle/tick2