Procházet zdrojové kódy

重构:还原老代码

LTCatt před 5 roky
rodič
revize
1cfc44c3f5
100 změnil soubory, kde provedl 1479 přidání a 5 odebrání
  1. 4 2
      data/ltw/functions/clock/tick5.mcfunction
  2. 12 0
      data/ltw/functions/state/0/sp/join_play.mcfunction
  3. 3 3
      data/ltw/functions/state/0/sp/join_watch.mcfunction
  4. 51 0
      data/ltw/functions/state/0/tick5.mcfunction
  5. binární
      data/old/backup/slime.zip
  6. 15 0
      data/old/item/advancements/container/place.json
  7. 15 0
      data/old/item/advancements/special/consume_enchanted_apple.json
  8. 15 0
      data/old/item/advancements/special/consume_golden_apple.json
  9. 15 0
      data/old/item/advancements/special/consume_totem.json
  10. 32 0
      data/old/item/functions/bonus_item/add_score.mcfunction
  11. 17 0
      data/old/item/functions/bonus_item/bonus_item_tag.json
  12. 9 0
      data/old/item/functions/bonus_item/call.mcfunction
  13. 30 0
      data/old/item/functions/bonus_item/call_each.mcfunction
  14. 14 0
      data/old/item/functions/bonus_item/gameparty/auto/blue.mcfunction
  15. 14 0
      data/old/item/functions/bonus_item/gameparty/auto/green.mcfunction
  16. 14 0
      data/old/item/functions/bonus_item/gameparty/auto/purple.mcfunction
  17. 6 0
      data/old/item/functions/bonus_item/gameparty/auto/random.mcfunction
  18. 14 0
      data/old/item/functions/bonus_item/gameparty/auto/white.mcfunction
  19. 11 0
      data/old/item/functions/bonus_item/gameparty/mixed/blue.mcfunction
  20. 11 0
      data/old/item/functions/bonus_item/gameparty/mixed/green.mcfunction
  21. 11 0
      data/old/item/functions/bonus_item/gameparty/mixed/purple.mcfunction
  22. 16 0
      data/old/item/functions/bonus_item/gameparty/mixed/random.mcfunction
  23. 11 0
      data/old/item/functions/bonus_item/gameparty/mixed/white.mcfunction
  24. 11 0
      data/old/item/functions/bonus_item/gameparty/score/blue.mcfunction
  25. 11 0
      data/old/item/functions/bonus_item/gameparty/score/green.mcfunction
  26. 11 0
      data/old/item/functions/bonus_item/gameparty/score/purple.mcfunction
  27. 16 0
      data/old/item/functions/bonus_item/gameparty/score/random.mcfunction
  28. 11 0
      data/old/item/functions/bonus_item/gameparty/score/white.mcfunction
  29. 9 0
      data/old/item/functions/bonus_item/give_items.mcfunction
  30. 4 0
      data/old/item/functions/bonus_item/new_array.mcfunction
  31. 5 0
      data/old/item/functions/bonus_item/pickup_1.mcfunction
  32. 5 0
      data/old/item/functions/bonus_item/pickup_2.mcfunction
  33. 9 0
      data/old/item/functions/bonus_item/random_bonus.mcfunction
  34. 2 0
      data/old/item/functions/bonus_item/random_bonus_rename.mcfunction
  35. 9 0
      data/old/item/functions/bonus_item/random_item.mcfunction
  36. 9 0
      data/old/item/functions/bonus_item/random_mixed.mcfunction
  37. 9 0
      data/old/item/functions/bonus_item/random_score.mcfunction
  38. 7 0
      data/old/item/functions/bonus_item/return_item.mcfunction
  39. 22 0
      data/old/item/functions/bonus_item/stole_score.mcfunction
  40. 8 0
      data/old/item/functions/bonus_item/tp.mcfunction
  41. 3 0
      data/old/item/functions/comment/clear_book.mcfunction
  42. 3 0
      data/old/item/functions/comment/give_book.mcfunction
  43. 1 0
      data/old/item/functions/container/check/call.mcfunction
  44. 4 0
      data/old/item/functions/container/explode.mcfunction
  45. 6 0
      data/old/item/functions/container/placed/call.mcfunction
  46. 10 0
      data/old/item/functions/container/placed/recu.mcfunction
  47. 8 0
      data/old/item/functions/disable_slot/check_slot.mcfunction
  48. 4 0
      data/old/item/functions/disable_slot/disable_slot_7.mcfunction
  49. 4 0
      data/old/item/functions/disable_slot/disable_slot_8.mcfunction
  50. 10 0
      data/old/item/functions/disable_throw.mcfunction
  51. 6 0
      data/old/item/functions/init.mcfunction
  52. 17 0
      data/old/item/functions/particle/show_particle.mcfunction
  53. 85 0
      data/old/item/functions/pop_slot/pop_all.mcfunction
  54. 9 0
      data/old/item/functions/pop_slot/pop_item.mcfunction
  55. 10 0
      data/old/item/functions/pop_slot/return_item.mcfunction
  56. 85 0
      data/old/item/functions/pop_slot/select_item.mcfunction
  57. 16 0
      data/old/item/functions/shop/buy_apple1.mcfunction
  58. 16 0
      data/old/item/functions/shop/buy_apple2.mcfunction
  59. 16 0
      data/old/item/functions/shop/buy_armor1.mcfunction
  60. 16 0
      data/old/item/functions/shop/buy_armor2.mcfunction
  61. 16 0
      data/old/item/functions/shop/buy_armor3.mcfunction
  62. 16 0
      data/old/item/functions/shop/buy_arrow1.mcfunction
  63. 16 0
      data/old/item/functions/shop/buy_arrow2.mcfunction
  64. 16 0
      data/old/item/functions/shop/buy_arrow3.mcfunction
  65. 16 0
      data/old/item/functions/shop/buy_bgm.mcfunction
  66. 16 0
      data/old/item/functions/shop/buy_bow.mcfunction
  67. 15 0
      data/old/item/functions/shop/buy_dice.mcfunction
  68. 16 0
      data/old/item/functions/shop/buy_easter_egg.mcfunction
  69. 16 0
      data/old/item/functions/shop/buy_firework.mcfunction
  70. 16 0
      data/old/item/functions/shop/buy_orange.mcfunction
  71. 11 0
      data/old/item/functions/shop/buy_particle0.mcfunction
  72. 11 0
      data/old/item/functions/shop/buy_particle1.mcfunction
  73. 25 0
      data/old/item/functions/shop/buy_particle2.mcfunction
  74. 25 0
      data/old/item/functions/shop/buy_particle3.mcfunction
  75. 25 0
      data/old/item/functions/shop/buy_particle4.mcfunction
  76. 25 0
      data/old/item/functions/shop/buy_particle5.mcfunction
  77. 25 0
      data/old/item/functions/shop/buy_particle6.mcfunction
  78. 17 0
      data/old/item/functions/shop/buy_particle_system.mcfunction
  79. 15 0
      data/old/item/functions/shop/buy_pig.mcfunction
  80. 16 0
      data/old/item/functions/shop/buy_potion_resist.mcfunction
  81. 16 0
      data/old/item/functions/shop/buy_potion_speed1.mcfunction
  82. 16 0
      data/old/item/functions/shop/buy_potion_speed2.mcfunction
  83. 16 0
      data/old/item/functions/shop/buy_weapon1.mcfunction
  84. 16 0
      data/old/item/functions/shop/buy_weapon2.mcfunction
  85. 16 0
      data/old/item/functions/shop/buy_weapon3.mcfunction
  86. 16 0
      data/old/item/functions/shop/buy_weapon4.mcfunction
  87. 10 0
      data/old/item/functions/shop/charity.mcfunction
  88. 39 0
      data/old/item/functions/shop/check.mcfunction
  89. 5 0
      data/old/item/functions/shop/error.mcfunction
  90. 24 0
      data/old/item/functions/shop/puzzle.mcfunction
  91. 36 0
      data/old/item/functions/shop/refresh_equip.mcfunction
  92. 24 0
      data/old/item/functions/shop/refresh_gold.mcfunction
  93. 17 0
      data/old/item/functions/shop/refresh_green.mcfunction
  94. 1 0
      data/old/item/functions/shop/special_bgm.mcfunction
  95. 1 0
      data/old/item/functions/shop/special_easter_egg.mcfunction
  96. 1 0
      data/old/item/functions/shop/special_pig.mcfunction
  97. 11 0
      data/old/item/functions/shop/summon_emerald.mcfunction
  98. 11 0
      data/old/item/functions/shop/summon_emerald_block.mcfunction
  99. 11 0
      data/old/item/functions/shop/summon_gold.mcfunction
  100. 11 0
      data/old/item/functions/shop/summon_gold_block.mcfunction

+ 4 - 2
data/ltw/functions/clock/tick5.mcfunction

@@ -1,7 +1,9 @@
 # 每 5 Tick 执行一次
 schedule function ltw:clock/tick5 5t replace
 
-# # 调用其他模块
-# execute if score $state mem matches 0 run function ltw:state/0/tick5
+# 调用其他模块
+execute if score $state mem matches 0 run function ltw:state/0/tick5
+
+
 # execute if score $state mem matches 5 run function ltw:state/5/tick5
 # function ltw:main/tick5

+ 12 - 0
data/ltw/functions/state/0/sp/join_play.mcfunction

@@ -0,0 +1,12 @@
+
+# 物品
+clear @s lime_dye{lobby_item:1b}
+clear @s gray_dye{lobby_item:1b}
+kill @e[type=item,nbt={Item:{id:"minecraft:gray_dye",tag:{lobby_item:1b}}}]
+# execute if data entity @s Inventory[{Slot:0b}] run scoreboard players set @s item_slot 0
+# execute if data entity @s Inventory[{Slot:0b}] at @s run function item:pop_slot/return_item
+replaceitem entity @s hotbar.0 lime_dye{lobby_item:1b,display:{Name:'[{"text":"","color":"green","italic":false},"准备模式 (按 ",{"keybind":"key.drop"}," 旁观)"]',Lore:['[{"text":"","color":"gray","italic":false},"你将在下一局参与游戏"]']}}
+execute at @s run function lib:sounds/hit2
+
+# 队伍
+team join hub_play @s

+ 3 - 3
data/ltw/functions/state/0/sp/join_watch.mcfunction

@@ -3,9 +3,9 @@
 clear @s lime_dye{lobby_item:1b}
 clear @s gray_dye{lobby_item:1b}
 kill @e[type=item,nbt={Item:{id:"minecraft:lime_dye",tag:{lobby_item:1b}}}]
-execute if data entity @s Inventory[{Slot:1b}] run scoreboard players set @s item_slot 1
-execute if data entity @s Inventory[{Slot:1b}] at @s run function item:pop_slot/return_item
-replaceitem entity @s hotbar.1 gray_dye{lobby_item:1b,display:{Name:'[{"text":"","color":"white","italic":false},"旁观模式 (按 ",{"keybind":"key.drop"}," 准备)"]',Lore:['[{"text":"","color":"gray","italic":false},"你将在下一局旁观游戏"]']}}
+# execute if data entity @s Inventory[{Slot:0b}] run scoreboard players set @s item_slot 0
+# execute if data entity @s Inventory[{Slot:0b}] at @s run function item:pop_slot/return_item
+replaceitem entity @s hotbar.0 gray_dye{lobby_item:1b,display:{Name:'[{"text":"","color":"white","italic":false},"旁观模式 (按 ",{"keybind":"key.drop"}," 准备)"]',Lore:['[{"text":"","color":"gray","italic":false},"你将在下一局旁观游戏"]']}}
 execute at @s run function lib:sounds/hit2
 
 # 队伍

+ 51 - 0
data/ltw/functions/state/0/tick5.mcfunction

@@ -0,0 +1,51 @@
+
+# 隐藏/显示 骰子房老板的名片
+execute as @e[type=piglin,tag=shop_piglin_11,tag=lobby_entity] at @s if entity @a[distance=..5] run data modify entity @s CustomNameVisible set value true
+execute as @e[type=piglin,tag=shop_piglin_11,tag=lobby_entity] at @s unless entity @a[distance=..5] run data modify entity @s CustomNameVisible set value false
+
+# ————————————————————————————————————————————————————————————————————————————
+# 游戏准备检查部分
+# ————————————————————————————————————————————————————————————————————————————
+
+# 检查已准备人数
+execute store result score $count mem if entity @a[team=hub_play]
+
+# 开始:提示开始
+execute if score $count mem matches 3.. if score #start_countdown mem matches 999.. run tellraw @a [{"text":"","color":"green"},{"text": ">> ","bold": true},"游戏即将开始, 请使用快捷栏最后一格确定自己是否参与!"]
+execute if score $count mem matches 3.. if score #start_countdown mem matches 999.. as @a at @s run function lib:sounds/levelup
+execute if score $count mem matches 3.. if score #start_countdown mem matches 999.. run scoreboard players set #start_countdown mem 121
+
+# 取消:提示取消
+execute if score $count mem matches ..2 if score #start_countdown mem matches ..999 run tellraw @a [{"text":"","color":"red"},{"text": ">> ","bold": true},"已准备人数不足, 游戏取消!"]
+execute if score $count mem matches ..2 if score #start_countdown mem matches ..999 as @a at @s run function lib:sounds/error
+execute if score $count mem matches ..2 if score #start_countdown mem matches ..999 run scoreboard players set #start_countdown mem 9999999
+
+# 播放音效
+scoreboard players remove #start_countdown mem 1
+scoreboard players operation #start_sec mem = #start_countdown mem
+scoreboard players operation #start_sec mem /= #const_4 mem
+scoreboard players operation #start_div mem = #start_countdown mem
+scoreboard players operation #start_div mem %= #const_4 mem
+execute if score #start_sec mem matches 1..10 if score #start_div mem matches 3 run execute as @a at @s run function lib:sounds/hit2
+
+# 20s:提示未准备
+execute if score #start_countdown mem matches 80 run tellraw @a[team=watching] [{"text":"","color":"red"},{"text":">> ","bold": true},"你还没有准备, 如果要参加游戏, 请丢出快捷栏最后一格的物品!"]
+
+# 10s:提示玩家数量过多
+execute if score #start_countdown mem matches 40 if score $count mem matches 9.. run tellraw @a [{"text":"","color":"gold"},{"text":">> ","bold": true},"已超出游戏最多支持的 8 人人数上限, 将随机抽取 8 人开始游戏!"]
+
+# 0s:开始游戏
+execute if score #start_countdown mem matches 0 run function ltw:state/0/start_game
+
+# 显示信息
+execute store result score #total_count mem if entity @a
+execute if score #start_countdown mem matches 1..199 run title @a[team=!debugging] actionbar [{"text":"","color":"green"},{"score":{"name":"$count","objective":"mem"}},"/",{"score":{"name":"#total_count","objective":"mem"}}," 人已准备 | ","将在 ",{"score":{"name":"#start_sec","objective":"mem"}}," 秒后开始游戏"]
+execute if score #start_countdown mem matches 200.. run title @a[team=!debugging] actionbar [{"text":"","color":"red"},{"score":{"name":"$count","objective":"mem"}},"/",{"score":{"name":"#total_count","objective":"mem"}}," 人已准备 | 需要 3 人以开始游戏"]
+
+## 让无状态玩家变为旁观状态
+#execute as @a[team=!debug,team=!hub_play,team=!hub_watch] run function ltw:state/0/sp/join_watch
+
+## 给予主大厅进度
+#execute as @a at @s if entity @s[x=-1,y=22,z=-29,dx=5,dy=3,dz=3] run advancement grant @s only ltw:parkour/explore1
+#execute as @a at @s if entity @s[x=6,y=48,z=-32,dx=4,dy=3,dz=9] run advancement grant @s only ltw:parkour/explore2
+#execute as @a at @s if entity @s[x=0,y=28,z=-46,distance=..4] run advancement grant @s only ltw:parkour/explore3

binární
data/old/backup/slime.zip


+ 15 - 0
data/old/item/advancements/container/place.json

@@ -0,0 +1,15 @@
+{
+    "criteria": {
+        "place_furnace":{
+            "trigger": "minecraft:placed_block",
+            "conditions": {
+                "item": {
+                    "tag": "item:container"
+                }
+            }
+        }
+    },
+    "rewards": {
+        "function": "item:container/placed/call"
+    }
+}

+ 15 - 0
data/old/item/advancements/special/consume_enchanted_apple.json

@@ -0,0 +1,15 @@
+{
+    "criteria": {
+        "consume_ega": {
+            "trigger": "minecraft:consume_item",
+            "conditions": {
+                "item": {
+                    "item": "minecraft:enchanted_golden_apple"
+                }
+            }
+        }
+    },
+    "rewards": {
+        "function": "item:special/enchanted_apple"
+    }
+}

+ 15 - 0
data/old/item/advancements/special/consume_golden_apple.json

@@ -0,0 +1,15 @@
+{
+    "criteria": {
+        "consume_ga": {
+            "trigger": "minecraft:consume_item",
+            "conditions": {
+                "item": {
+                    "item": "minecraft:golden_apple"
+                }
+            }
+        }
+    },
+    "rewards": {
+        "function": "item:special/golden_apple"
+    }
+}

+ 15 - 0
data/old/item/advancements/special/consume_totem.json

@@ -0,0 +1,15 @@
+{
+    "criteria": {
+        "consume_ga": {
+            "trigger": "minecraft:used_totem",
+            "conditions": {
+                "item": {
+                    "item": "minecraft:totem_of_undying"
+                }
+            }
+        }
+    },
+    "rewards": {
+        "function": "item:special/totem"
+    }
+}

+ 32 - 0
data/old/item/functions/bonus_item/add_score.mcfunction

@@ -0,0 +1,32 @@
+#as player
+execute store result score #bonus_add_score mem run data get storage item:bonus item.tag.bonus_add_score
+
+# 正常的加分
+execute if score #bonus_add_score mem matches ..10 run scoreboard players operation @s total_score += #bonus_add_score mem
+execute if score #bonus_add_score mem matches ..10 run scoreboard players operation @s total_score_disp += #bonus_add_score mem
+execute if score #bonus_add_score mem matches ..10 run tellraw @a ["",{"text": ">> ","color":"aqua","bold": true},{"selector": "@s","color":"aqua"}," 获得了 ",{"score": {"name":"#bonus_add_score","objective": "mem"},"color":"aqua"},{"text": " 分","color":"aqua"},", 当前共有 ",{"score": {"name": "@s","objective": "total_score"}}, " 分"]
+
+# 100:普通硬币 / 101:高级硬币
+scoreboard players set $random_max mem 1
+scoreboard players set $random_min mem 0
+function lib:random
+execute if score #bonus_add_score mem matches 100..101 if score $random mem matches 1 run scoreboard players operation @s total_score *= #const_2 mem
+execute if score #bonus_add_score mem matches 100..101 if score $random mem matches 1 run scoreboard players operation @s total_score_disp *= #const_2 mem
+execute if score #bonus_add_score mem matches 100..101 if score $random mem matches 1 run tellraw @a ["",{"text": ">> ","color":"green","bold": true},{"selector": "@s","color":"green"}," 的硬币投出了正面, 得分加倍, 当前共有 ",{"score": {"name": "@s","objective": "total_score"},"color":"green"},{"text": " 分", "color":"green"}]
+execute if score #bonus_add_score mem matches 100 if score $random mem matches 0 run scoreboard players operation @s total_score /= #const_2 mem
+execute if score #bonus_add_score mem matches 100 if score $random mem matches 0 run scoreboard players operation @s total_score_disp /= #const_2 mem
+execute if score #bonus_add_score mem matches 100 if score $random mem matches 0 run tellraw @a ["",{"text": ">> ","color":"red","bold": true},{"selector": "@s","color":"red"}," 的硬币投出了反面, 得分减半, 当前共有 ",{"score": {"name": "@s","objective": "total_score"},"color":"red"},{"text": " 分", "color":"red"}]
+execute if score #bonus_add_score mem matches 101 if score $random mem matches 0 run tellraw @a ["",{"text": ">> ","color":"red","bold": true},{"selector": "@s","color":"red"}," 的硬币投出了反面, 得分不变, 当前共有 ",{"score": {"name": "@s","objective": "total_score"},"color":"red"},{"text": " 分", "color":"red"}]
+
+# 200:偷分
+execute if score #bonus_add_score mem matches 200 run function item:bonus_item/stole_score
+
+# 300:金粒 +7
+execute if score #bonus_add_score mem matches 300 run scoreboard players add @s gold 7
+execute if score #bonus_add_score mem matches 300 run scoreboard players add @s gold_total 7
+execute if score #bonus_add_score mem matches 300 run tellraw @a ["",{"text": ">> ","color":"aqua","bold": true},{"selector": "@s","color":"aqua"}," 获得了 7 金粒"]
+
+# 给予进度
+execute if entity @s[scores={total_score=10..}] run advancement grant @s only ltw:story/score1
+execute if entity @s[scores={total_score=18..}] run advancement grant @s only ltw:story/score2
+execute if entity @s[scores={total_score=26..}] run advancement grant @s only ltw:story/score3

+ 17 - 0
data/old/item/functions/bonus_item/bonus_item_tag.json

@@ -0,0 +1,17 @@
+{
+    "is_bonus": true,
+    "bonus_clear_nbt":true,
+    "bonus_new": true,
+    "bonus_return": true,
+    "item_name":"{\"text\": \"破损的钓鱼竿\",\"color\": \"green\"}",
+    "bonus_add_score":15,
+    "bonus_stole_score":3,
+    "bonus_give_items":[
+        {"id":"minecraft:stone","Count":64,"tag":{"is_bonus":true,"display":{"Name":"\"普通的石头\""}}},
+        {"id":"minecraft:arrow","Count":64,"tag":{"is_bonus":true}}
+    ],
+    "bonus_random_bonus":[
+        {"type":"normal","level":"white","count":2},
+        {"type":"score","level":"green","count":1}
+    ]
+}

+ 9 - 0
data/old/item/functions/bonus_item/call.mcfunction

@@ -0,0 +1,9 @@
+# 当玩家拾取到奖励物品时触发
+# as player
+
+# 获取玩家待处理奖励物品列表
+data modify storage item:bonus item_buff set value []
+data modify storage item:bonus item_buff append from entity @s Inventory[{"tag":{"bonus_new":1b}}]
+clear @s #item:bonus{"bonus_new":1b}
+
+execute if data storage item:bonus item_buff[0] run function item:bonus_item/call_each

+ 30 - 0
data/old/item/functions/bonus_item/call_each.mcfunction

@@ -0,0 +1,30 @@
+# 处理单个奖励物品
+# as player
+
+# 获取当前物品
+data modify storage item:bonus item set from storage item:bonus item_buff[0]
+data remove storage item:bonus item_buff[0]
+
+# 播放音效
+function lib:sounds/hit
+
+# 显示拾取提示(获得得分的提示由 add_score 显示,获得随机物品则该物品不显示)
+execute unless data storage item:bonus item.tag.bonus_add_score unless data storage item:bonus item.tag.bonus_random_bonus[0] run tellraw @a ["",{"text": ">> ","color":"aqua","bold": true},{"selector": "@s","color":"aqua"}," 获得了 ",{"nbt": "item.tag.item_name","storage":"item:bonus","interpret": true}]
+
+# 如果有 return 标签则退回物品(最先执行)
+execute if data storage item:bonus item.tag{"bonus_return":1b} run function item:bonus_item/return_item
+
+# 如果有 add_score 标签则增加积分
+execute if data storage item:bonus item.tag.bonus_add_score run function item:bonus_item/add_score
+
+# 如果有 give_items 标签则给予物品
+execute if data storage item:bonus item.tag.bonus_give_items[0] run function item:bonus_item/give_items
+
+# 如果有 random_bonus 标签则返还随机物品
+execute if data storage item:bonus item.tag.bonus_random_bonus[0] run function item:bonus_item/random_bonus
+
+# 执行特定函数
+execute if score $state mem matches 7 run function item:bonus_item/pickup_1
+
+# 处理下一个
+execute if data storage item:bonus item_buff[0] run function item:bonus_item/call_each

+ 14 - 0
data/old/item/functions/bonus_item/gameparty/auto/blue.mcfunction

@@ -0,0 +1,14 @@
+# 生成蓝色品质的物品实体
+
+execute if score $round mem matches ..2 run function item:bonus_item/gameparty/mixed/blue
+execute if score $round mem matches 3 run function item:bonus_item/gameparty/score/blue
+execute if score $round mem matches 4 run function item:bonus_item/gameparty/mixed/blue
+execute if score $round mem matches 5.. run function item:bonus_item/gameparty/score/blue
+summon item ~ ~ ~ {Tags:["new_item"],Age:-32768,PickupDelay:0,NoGravity:1,Invulnerable:1,CustomNameVisible:1,Glowing:1,Motion:[0,0,0],Item:{id:"gold_nugget",Count:1}}
+data modify entity @e[tag=new_item,limit=1] Item set from entity @e[limit=1,type=item,sort=nearest,tag=!new_item] Item
+kill @e[limit=1,type=item,sort=nearest,tag=!new_item]
+execute as @e[tag=new_item] run data modify entity @s CustomName set from entity @s Item.tag.item_name
+team join blue @e[tag=new_item]
+tag @e[tag=new_item] add item_blue
+tag @e[tag=new_item] add item_new
+tag @e[tag=new_item] remove new_item

+ 14 - 0
data/old/item/functions/bonus_item/gameparty/auto/green.mcfunction

@@ -0,0 +1,14 @@
+# 生成绿色品质的物品实体
+
+execute if score $round mem matches ..2 run function item:bonus_item/gameparty/mixed/green
+execute if score $round mem matches 3 run function item:bonus_item/gameparty/score/green
+execute if score $round mem matches 4 run function item:bonus_item/gameparty/mixed/green
+execute if score $round mem matches 5.. run function item:bonus_item/gameparty/score/green
+summon item ~ ~ ~ {Tags:["new_item"],Age:-32768,PickupDelay:0,NoGravity:1,Invulnerable:1,CustomNameVisible:1,Glowing:1,Motion:[0,0,0],Item:{id:"gold_nugget",Count:1}}
+data modify entity @e[tag=new_item,limit=1] Item set from entity @e[limit=1,type=item,sort=nearest,tag=!new_item] Item
+kill @e[limit=1,type=item,sort=nearest,tag=!new_item]
+execute as @e[tag=new_item] run data modify entity @s CustomName set from entity @s Item.tag.item_name
+team join green @e[tag=new_item]
+tag @e[tag=new_item] add item_green
+tag @e[tag=new_item] add item_new
+tag @e[tag=new_item] remove new_item

+ 14 - 0
data/old/item/functions/bonus_item/gameparty/auto/purple.mcfunction

@@ -0,0 +1,14 @@
+# 生成紫色品质的物品实体
+
+execute if score $round mem matches ..2 run function item:bonus_item/gameparty/mixed/purple
+execute if score $round mem matches 3 run function item:bonus_item/gameparty/score/purple
+execute if score $round mem matches 4 run function item:bonus_item/gameparty/mixed/purple
+execute if score $round mem matches 5.. run function item:bonus_item/gameparty/score/purple
+summon item ~ ~ ~ {Tags:["new_item"],Age:-32768,PickupDelay:0,NoGravity:1,Invulnerable:1,CustomNameVisible:1,Glowing:1,Motion:[0,0,0],Item:{id:"gold_nugget",Count:1}}
+data modify entity @e[tag=new_item,limit=1] Item set from entity @e[limit=1,type=item,sort=nearest,tag=!new_item] Item
+kill @e[limit=1,type=item,sort=nearest,tag=!new_item]
+execute as @e[tag=new_item] run data modify entity @s CustomName set from entity @s Item.tag.item_name
+team join purple @e[tag=new_item]
+tag @e[tag=new_item] add item_purple
+tag @e[tag=new_item] add item_new
+tag @e[tag=new_item] remove new_item

+ 6 - 0
data/old/item/functions/bonus_item/gameparty/auto/random.mcfunction

@@ -0,0 +1,6 @@
+# 根据轮数生成对应的物品
+
+execute if score $round mem matches ..2 run function item:bonus_item/gameparty/mixed/random
+execute if score $round mem matches 3 run function item:bonus_item/gameparty/score/random
+execute if score $round mem matches 4 run function item:bonus_item/gameparty/mixed/random
+execute if score $round mem matches 5.. run function item:bonus_item/gameparty/score/random

+ 14 - 0
data/old/item/functions/bonus_item/gameparty/auto/white.mcfunction

@@ -0,0 +1,14 @@
+# 生成白色品质的物品实体
+
+execute if score $round mem matches ..2 run function item:bonus_item/gameparty/mixed/white
+execute if score $round mem matches 3 run function item:bonus_item/gameparty/score/white
+execute if score $round mem matches 4 run function item:bonus_item/gameparty/mixed/white
+execute if score $round mem matches 5.. run function item:bonus_item/gameparty/score/white
+summon item ~ ~ ~ {Tags:["new_item"],Age:-32768,PickupDelay:0,NoGravity:1,Invulnerable:1,CustomNameVisible:1,Glowing:1,Motion:[0,0,0],Item:{id:"gold_nugget",Count:1}}
+data modify entity @e[tag=new_item,limit=1] Item set from entity @e[limit=1,type=item,sort=nearest,tag=!new_item] Item
+kill @e[limit=1,type=item,sort=nearest,tag=!new_item]
+execute as @e[tag=new_item] run data modify entity @s CustomName set from entity @s Item.tag.item_name
+team join white @e[tag=new_item]
+tag @e[tag=new_item] add item_white
+tag @e[tag=new_item] add item_new
+tag @e[tag=new_item] remove new_item

+ 11 - 0
data/old/item/functions/bonus_item/gameparty/mixed/blue.mcfunction

@@ -0,0 +1,11 @@
+# 生成蓝色品质的物品实体
+
+loot spawn ~ ~ ~ loot item:gameparty/mixed/blue
+summon item ~ ~ ~ {Tags:["new_item"],Age:-32768,PickupDelay:0,NoGravity:1,Invulnerable:1,CustomNameVisible:1,Glowing:1,Motion:[0,0,0],Item:{id:"gold_nugget",Count:1}}
+data modify entity @e[tag=new_item,limit=1] Item set from entity @e[limit=1,type=item,sort=nearest,tag=!new_item] Item
+kill @e[limit=1,type=item,sort=nearest,tag=!new_item]
+execute as @e[tag=new_item] run data modify entity @s CustomName set from entity @s Item.tag.item_name
+team join blue @e[tag=new_item]
+tag @e[tag=new_item] add item_blue
+tag @e[tag=new_item] add item_new
+tag @e[tag=new_item] remove new_item

+ 11 - 0
data/old/item/functions/bonus_item/gameparty/mixed/green.mcfunction

@@ -0,0 +1,11 @@
+# 生成绿色品质的物品实体
+
+loot spawn ~ ~ ~ loot item:gameparty/mixed/green
+summon item ~ ~ ~ {Tags:["new_item"],Age:-32768,PickupDelay:0,NoGravity:1,Invulnerable:1,CustomNameVisible:1,Glowing:1,Motion:[0,0,0],Item:{id:"gold_nugget",Count:1}}
+data modify entity @e[tag=new_item,limit=1] Item set from entity @e[limit=1,type=item,sort=nearest,tag=!new_item] Item
+kill @e[limit=1,type=item,sort=nearest,tag=!new_item]
+execute as @e[tag=new_item] run data modify entity @s CustomName set from entity @s Item.tag.item_name
+team join green @e[tag=new_item]
+tag @e[tag=new_item] add item_green
+tag @e[tag=new_item] add item_new
+tag @e[tag=new_item] remove new_item

+ 11 - 0
data/old/item/functions/bonus_item/gameparty/mixed/purple.mcfunction

@@ -0,0 +1,11 @@
+# 生成紫色品质的物品实体
+
+loot spawn ~ ~ ~ loot item:gameparty/mixed/purple
+summon item ~ ~ ~ {Tags:["new_item"],Age:-32768,PickupDelay:0,NoGravity:1,Invulnerable:1,CustomNameVisible:1,Glowing:1,Motion:[0,0,0],Item:{id:"gold_nugget",Count:1}}
+data modify entity @e[tag=new_item,limit=1] Item set from entity @e[limit=1,type=item,sort=nearest,tag=!new_item] Item
+kill @e[limit=1,type=item,sort=nearest,tag=!new_item]
+execute as @e[tag=new_item] run data modify entity @s CustomName set from entity @s Item.tag.item_name
+team join purple @e[tag=new_item]
+tag @e[tag=new_item] add item_purple
+tag @e[tag=new_item] add item_new
+tag @e[tag=new_item] remove new_item

+ 16 - 0
data/old/item/functions/bonus_item/gameparty/mixed/random.mcfunction

@@ -0,0 +1,16 @@
+# 生成随机品质的物品
+
+# 品质:生成一个 1~10 的 randomarray,每次从其中取下一个数
+execute unless data storage ltw:mini qualities[0] run function item:bonus_item/new_array
+execute store result score #quality mem run data get storage ltw:mini qualities[0]
+data remove storage ltw:mini qualities[0]
+
+# 根据品质生成不同的物品
+# 白色:40%
+execute if score #quality mem matches ..4 run function item:bonus_item/gameparty/mixed/white
+# 绿色:30%
+execute if score #quality mem matches 5..7 run function item:bonus_item/gameparty/mixed/green
+# 蓝色:20%
+execute if score #quality mem matches 8..9 run function item:bonus_item/gameparty/mixed/blue
+# 紫色:10%
+execute if score #quality mem matches 10.. run function item:bonus_item/gameparty/mixed/purple

+ 11 - 0
data/old/item/functions/bonus_item/gameparty/mixed/white.mcfunction

@@ -0,0 +1,11 @@
+# 生成白色品质的物品实体
+
+loot spawn ~ ~ ~ loot item:gameparty/mixed/white
+summon item ~ ~ ~ {Tags:["new_item"],Age:-32768,PickupDelay:0,NoGravity:1,Invulnerable:1,CustomNameVisible:1,Glowing:1,Motion:[0,0,0],Item:{id:"gold_nugget",Count:1}}
+data modify entity @e[tag=new_item,limit=1] Item set from entity @e[limit=1,type=item,sort=nearest,tag=!new_item] Item
+kill @e[limit=1,type=item,sort=nearest,tag=!new_item]
+execute as @e[tag=new_item] run data modify entity @s CustomName set from entity @s Item.tag.item_name
+team join white @e[tag=new_item]
+tag @e[tag=new_item] add item_white
+tag @e[tag=new_item] add item_new
+tag @e[tag=new_item] remove new_item

+ 11 - 0
data/old/item/functions/bonus_item/gameparty/score/blue.mcfunction

@@ -0,0 +1,11 @@
+# 生成蓝色品质的物品实体
+
+loot spawn ~ ~ ~ loot item:gameparty/score/blue
+summon item ~ ~ ~ {Tags:["new_item"],Age:-32768,PickupDelay:0,NoGravity:1,Invulnerable:1,CustomNameVisible:1,Glowing:1,Motion:[0,0,0],Item:{id:"gold_nugget",Count:1}}
+data modify entity @e[tag=new_item,limit=1] Item set from entity @e[limit=1,type=item,sort=nearest,tag=!new_item] Item
+kill @e[limit=1,type=item,sort=nearest,tag=!new_item]
+execute as @e[tag=new_item] run data modify entity @s CustomName set from entity @s Item.tag.item_name
+team join blue @e[tag=new_item]
+tag @e[tag=new_item] add item_blue
+tag @e[tag=new_item] add item_new
+tag @e[tag=new_item] remove new_item

+ 11 - 0
data/old/item/functions/bonus_item/gameparty/score/green.mcfunction

@@ -0,0 +1,11 @@
+# 生成绿色品质的物品实体
+
+loot spawn ~ ~ ~ loot item:gameparty/score/green
+summon item ~ ~ ~ {Tags:["new_item"],Age:-32768,PickupDelay:0,NoGravity:1,Invulnerable:1,CustomNameVisible:1,Glowing:1,Motion:[0,0,0],Item:{id:"gold_nugget",Count:1}}
+data modify entity @e[tag=new_item,limit=1] Item set from entity @e[limit=1,type=item,sort=nearest,tag=!new_item] Item
+kill @e[limit=1,type=item,sort=nearest,tag=!new_item]
+execute as @e[tag=new_item] run data modify entity @s CustomName set from entity @s Item.tag.item_name
+team join green @e[tag=new_item]
+tag @e[tag=new_item] add item_green
+tag @e[tag=new_item] add item_new
+tag @e[tag=new_item] remove new_item

+ 11 - 0
data/old/item/functions/bonus_item/gameparty/score/purple.mcfunction

@@ -0,0 +1,11 @@
+# 生成紫色品质的物品实体
+
+loot spawn ~ ~ ~ loot item:gameparty/score/purple
+summon item ~ ~ ~ {Tags:["new_item"],Age:-32768,PickupDelay:0,NoGravity:1,Invulnerable:1,CustomNameVisible:1,Glowing:1,Motion:[0,0,0],Item:{id:"gold_nugget",Count:1}}
+data modify entity @e[tag=new_item,limit=1] Item set from entity @e[limit=1,type=item,sort=nearest,tag=!new_item] Item
+kill @e[limit=1,type=item,sort=nearest,tag=!new_item]
+execute as @e[tag=new_item] run data modify entity @s CustomName set from entity @s Item.tag.item_name
+team join purple @e[tag=new_item]
+tag @e[tag=new_item] add item_purple
+tag @e[tag=new_item] add item_new
+tag @e[tag=new_item] remove new_item

+ 16 - 0
data/old/item/functions/bonus_item/gameparty/score/random.mcfunction

@@ -0,0 +1,16 @@
+# 生成随机品质的物品
+
+# 品质:生成一个 1~10 的 randomarray,每次从其中取下一个数
+execute unless data storage ltw:mini qualities[0] run function item:bonus_item/new_array
+execute store result score #quality mem run data get storage ltw:mini qualities[0]
+data remove storage ltw:mini qualities[0]
+
+# 根据品质生成不同的物品
+# 白色:40%
+execute if score #quality mem matches ..4 run function item:bonus_item/gameparty/score/white
+# 绿色:30%
+execute if score #quality mem matches 5..7 run function item:bonus_item/gameparty/score/green
+# 蓝色:20%
+execute if score #quality mem matches 8..9 run function item:bonus_item/gameparty/score/blue
+# 紫色:10%
+execute if score #quality mem matches 10.. run function item:bonus_item/gameparty/score/purple

+ 11 - 0
data/old/item/functions/bonus_item/gameparty/score/white.mcfunction

@@ -0,0 +1,11 @@
+# 生成白色品质的物品实体
+
+loot spawn ~ ~ ~ loot item:gameparty/score/white
+summon item ~ ~ ~ {Tags:["new_item"],Age:-32768,PickupDelay:0,NoGravity:1,Invulnerable:1,CustomNameVisible:1,Glowing:1,Motion:[0,0,0],Item:{id:"gold_nugget",Count:1}}
+data modify entity @e[tag=new_item,limit=1] Item set from entity @e[limit=1,type=item,sort=nearest,tag=!new_item] Item
+kill @e[limit=1,type=item,sort=nearest,tag=!new_item]
+execute as @e[tag=new_item] run data modify entity @s CustomName set from entity @s Item.tag.item_name
+team join white @e[tag=new_item]
+tag @e[tag=new_item] add item_white
+tag @e[tag=new_item] add item_new
+tag @e[tag=new_item] remove new_item

+ 9 - 0
data/old/item/functions/bonus_item/give_items.mcfunction

@@ -0,0 +1,9 @@
+#as player
+setblock 0 0 0 jukebox replace
+data modify block 0 0 0 RecordItem set from storage item:bonus item.tag.bonus_give_items[0]
+setblock 0 0 0 air destroy
+tag @s add item_op
+execute as @e[tag=!bonus_old,tag=!item_new,type=item,nbt={"Item":{"tag":{"is_bonus":1b}}},limit=1] run function item:bonus_item/tp
+tag @s remove item_op
+data remove storage item:bonus item.tag.bonus_give_items[0]
+execute if data storage item:bonus item.tag.bonus_give_items[0] run function item:bonus_item/give_items

+ 4 - 0
data/old/item/functions/bonus_item/new_array.mcfunction

@@ -0,0 +1,4 @@
+scoreboard players set $randarray_max mem 10
+scoreboard players set $randarray_last mem 0
+function lib:randarray/call
+data modify storage ltw:mini qualities set from storage lib:randarray out

+ 5 - 0
data/old/item/functions/bonus_item/pickup_1.mcfunction

@@ -0,0 +1,5 @@
+#当玩家在奖励阶段拾取奖励物品触发
+#as player
+tag @s add pickup_player
+tp @s 24.5 11.0 1967.5 112.5 25
+schedule function item:bonus_item/pickup_2 5t replace

+ 5 - 0
data/old/item/functions/bonus_item/pickup_2.mcfunction

@@ -0,0 +1,5 @@
+# 有玩家捡起物品,并处理完成后触发
+# 执行者为 System
+
+execute as @a[tag=pickup_player] run function ltw:state/7/pickup
+tag @a remove pickup_player

+ 9 - 0
data/old/item/functions/bonus_item/random_bonus.mcfunction

@@ -0,0 +1,9 @@
+#as player
+setblock 0 0 1 shulker_box replace
+data modify storage item:bonus random_bonus set from storage item:bonus item.tag.bonus_random_bonus[0]
+data remove storage item:bonus item.tag.bonus_random_bonus[0]
+execute store result score $item.random.count mem run data get storage item:bonus random_bonus.count
+execute if score $item.random.count mem matches 1.. if data storage item:bonus random_bonus{"type":"item"} run function item:bonus_item/random_item
+execute if score $item.random.count mem matches 1.. if data storage item:bonus random_bonus{"type":"mixed"} run function item:bonus_item/random_mixed
+execute if score $item.random.count mem matches 1.. if data storage item:bonus random_bonus{"type":"score"} run function item:bonus_item/random_score
+execute if data storage item:bonus item.tag.bonus_random_bonus[0] run function item:bonus_item/random_bonus

+ 2 - 0
data/old/item/functions/bonus_item/random_bonus_rename.mcfunction

@@ -0,0 +1,2 @@
+data modify block 0 1 0 Text1 set value '[{"text":"随机道具:","color":"#FFE9A1"},{"nbt": "item_buff[0].tag.item_name","storage":"item:bonus","interpret": true}]'
+data modify storage item:bonus item_buff[0].tag.item_name set from block 0 1 0 Text1

+ 9 - 0
data/old/item/functions/bonus_item/random_item.mcfunction

@@ -0,0 +1,9 @@
+#as player
+scoreboard players remove $item.random.count mem 1
+execute if data storage item:bonus random_bonus{"level":"white"} run loot replace block 0 0 1 container.0 loot item:gameparty/item/white
+execute if data storage item:bonus random_bonus{"level":"green"} run loot replace block 0 0 1 container.0 loot item:gameparty/item/green
+execute if data storage item:bonus random_bonus{"level":"blue"} run loot replace block 0 0 1 container.0 loot item:gameparty/item/blue
+execute if data storage item:bonus random_bonus{"level":"purple"} run loot replace block 0 0 1 container.0 loot item:gameparty/item/purple
+data modify storage item:bonus item_buff prepend from block 0 0 1 Items[{"Slot":0b}]
+function item:bonus_item/random_bonus_rename
+execute if score $item.random.count mem matches 1.. run function item:bonus_item/random_item

+ 9 - 0
data/old/item/functions/bonus_item/random_mixed.mcfunction

@@ -0,0 +1,9 @@
+#as player
+scoreboard players remove $item.random.count mem 1
+execute if data storage item:bonus random_bonus{"level":"white"} run loot replace block 0 0 1 container.0 loot item:gameparty/mixed/white
+execute if data storage item:bonus random_bonus{"level":"green"} run loot replace block 0 0 1 container.0 loot item:gameparty/mixed/green
+execute if data storage item:bonus random_bonus{"level":"blue"} run loot replace block 0 0 1 container.0 loot item:gameparty/mixed/blue
+execute if data storage item:bonus random_bonus{"level":"purple"} run loot replace block 0 0 1 container.0 loot item:gameparty/mixed/purple
+data modify storage item:bonus item_buff prepend from block 0 0 1 Items[{"Slot":0b}]
+function item:bonus_item/random_bonus_rename
+execute if score $item.random.count mem matches 1.. run function item:bonus_item/random_mixed

+ 9 - 0
data/old/item/functions/bonus_item/random_score.mcfunction

@@ -0,0 +1,9 @@
+#as player
+scoreboard players remove $item.random.count mem 1
+execute if data storage item:bonus random_bonus{"level":"white"} run loot replace block 0 0 1 container.0 loot item:gameparty/score/white
+execute if data storage item:bonus random_bonus{"level":"green"} run loot replace block 0 0 1 container.0 loot item:gameparty/score/green
+execute if data storage item:bonus random_bonus{"level":"blue"} run loot replace block 0 0 1 container.0 loot item:gameparty/score/blue
+execute if data storage item:bonus random_bonus{"level":"purple"} run loot replace block 0 0 1 container.0 loot item:gameparty/score/purple
+data modify storage item:bonus item_buff prepend from block 0 0 1 Items[{"Slot":0b}]
+function item:bonus_item/random_bonus_rename
+execute if score $item.random.count mem matches 1.. run function item:bonus_item/random_score

+ 7 - 0
data/old/item/functions/bonus_item/return_item.mcfunction

@@ -0,0 +1,7 @@
+setblock 0 0 0 jukebox replace
+data modify block 0 0 0 RecordItem set from storage item:bonus item
+data modify block 0 0 0 RecordItem.tag.bonus_new set value 0b
+setblock 0 0 0 air destroy
+tag @s add item_op
+execute as @e[tag=!bonus_old,tag=!item_new,type=item,nbt={"Item":{"tag":{"is_bonus":1b}}},limit=1] run function item:bonus_item/tp
+tag @s remove item_op

+ 22 - 0
data/old/item/functions/bonus_item/stole_score.mcfunction

@@ -0,0 +1,22 @@
+# as player
+execute store result score #bonus_stole_score mem run data get storage item:bonus item.tag.bonus_stole_score
+
+# 获取有效的最高分玩家
+function ltw:main/get_max_score
+tag @a remove highest
+tag @a remove may_highest
+execute as @a if score @s total_score = #score_max mem if score @s total_score >= #bonus_stole_score mem run tag @s add may_highest
+tag @s remove may_highest
+execute as @a[tag=may_highest,limit=1,sort=random,team=playing] run tag @s add highest
+execute unless entity @a[tag=highest] run tag @s add highest
+
+# 更改得分
+scoreboard players operation @s total_score += #bonus_stole_score mem
+scoreboard players operation @s total_score_disp += #bonus_stole_score mem
+scoreboard players operation @a[tag=highest] total_score -= #bonus_stole_score mem
+scoreboard players operation @a[tag=highest] total_score_disp -= #bonus_stole_score mem
+
+# 显示提示
+execute if entity @s[tag=highest] run tellraw @a ["",{"text": ">> ","color":"aqua","bold": true},{"selector": "@s","color":"aqua"}," 没能偷到任何人的分数……"]
+execute if entity @s[tag=!highest] run tellraw @a ["",{"text": ">> ","color":"red","bold": true},{"selector": "@a[tag=highest]","color":"red"}," 被偷取了 ",{"score": {"name": "#bonus_stole_score","objective": "mem"},"color":"red"},{"text": " 分","color":"red"},", 当前共有 ",{"score": {"name": "@a[tag=highest,limit=1]","objective": "total_score"}}, " 分"]
+execute if entity @s[tag=!highest] run tellraw @a ["",{"text": ">> ","color":"green","bold": true},{"selector": "@s","color":"green"}," 偷取了 ",{"score": {"name": "#bonus_stole_score","objective": "mem"},"color":"green"},{"text": " 分","color":"green"},", 当前共有 ",{"score": {"name": "@s","objective": "total_score"}}, " 分"]

+ 8 - 0
data/old/item/functions/bonus_item/tp.mcfunction

@@ -0,0 +1,8 @@
+#as item
+tp @s @a[tag=item_op,limit=1]
+tag @s add bonus_old
+data modify entity @s Owner set from entity @a[tag=item_op,limit=1] UUID
+data modify entity @s Thrower set from entity @a[tag=item_op,limit=1] UUID
+# 判断是否需要清除nbt tag
+execute if predicate item:bonus/clear_nbt run data remove entity @s Item.tag
+data modify entity @s PickupDelay set value 0

+ 3 - 0
data/old/item/functions/comment/clear_book.mcfunction

@@ -0,0 +1,3 @@
+loot insert 10 6 2 loot item:comment/written_book
+clear @s written_book
+tellraw @s [{"text":">> ","color":"green","bold":true},{"bold":false,"text":"你的反馈已成功提交!","color":"green"}]

+ 3 - 0
data/old/item/functions/comment/give_book.mcfunction

@@ -0,0 +1,3 @@
+loot give @s loot item:comment/writable_book
+tellraw @s [{"text":">> ","color":"gold","bold":true},{"bold":false,"text":"你获得了一本可以编辑的反馈书!","color":"gold"}]
+tellraw @s [{"text":">> ","color":"gold","bold":true},{"bold":false,"text":"提交前请署名, 书名请写反馈的主题!","color":"gold"}]

+ 1 - 0
data/old/item/functions/container/check/call.mcfunction

@@ -0,0 +1 @@
+execute as @e[tag=container] at @s if block ~ ~ ~ minecraft:furnace if data block ~ ~ ~ Items[{id:"minecraft:nether_star"}] run function item:container/explode

+ 4 - 0
data/old/item/functions/container/explode.mcfunction

@@ -0,0 +1,4 @@
+#as container as @s
+setblock ~ ~ ~ air
+summon tnt ~ ~ ~ {Fuse:0}
+kill @s

+ 6 - 0
data/old/item/functions/container/placed/call.mcfunction

@@ -0,0 +1,6 @@
+#as player
+#trigger by advancement
+advancement revoke @s only item:container/place
+scoreboard players set #container.got mem 0
+scoreboard players set #container.dist mem 0
+execute at @s anchored eyes positioned ^ ^ ^1 run function item:container/placed/recu

+ 10 - 0
data/old/item/functions/container/placed/recu.mcfunction

@@ -0,0 +1,10 @@
+#as player
+execute if score #container.got mem matches 0 positioned ~ ~ ~ align xyz store success score #container.got mem unless entity @e[tag=container,dx=0,dy=0,dz=0] if block ~ ~ ~ #item:container run summon minecraft:area_effect_cloud ~.5 ~ ~.5 {Age: -2147483648, Duration: -1, WaitTime: -2147483648, Tags: ["container"]}
+execute if score #container.got mem matches 0 positioned ~1 ~ ~ align xyz store success score #container.got mem unless entity @e[tag=container,dx=0,dy=0,dz=0] if block ~ ~ ~ #item:container run summon minecraft:area_effect_cloud ~.5 ~ ~.5 {Age: -2147483648, Duration: -1, WaitTime: -2147483648, Tags: ["container"]}
+execute if score #container.got mem matches 0 positioned ~-1 ~ ~ align xyz store success score #container.got mem unless entity @e[tag=container,dx=0,dy=0,dz=0] if block ~ ~ ~ #item:container run summon minecraft:area_effect_cloud ~.5 ~ ~.5 {Age: -2147483648, Duration: -1, WaitTime: -2147483648, Tags: ["container"]}
+execute if score #container.got mem matches 0 positioned ~ ~1 ~ align xyz store success score #container.got mem unless entity @e[tag=container,dx=0,dy=0,dz=0] if block ~ ~ ~ #item:container run summon minecraft:area_effect_cloud ~.5 ~ ~.5 {Age: -2147483648, Duration: -1, WaitTime: -2147483648, Tags: ["container"]}
+execute if score #container.got mem matches 0 positioned ~ ~-1 ~ align xyz store success score #container.got mem unless entity @e[tag=container,dx=0,dy=0,dz=0] if block ~ ~ ~ #item:container run summon minecraft:area_effect_cloud ~.5 ~ ~.5 {Age: -2147483648, Duration: -1, WaitTime: -2147483648, Tags: ["container"]}
+execute if score #container.got mem matches 0 positioned ~ ~ ~1 align xyz store success score #container.got mem unless entity @e[tag=container,dx=0,dy=0,dz=0] if block ~ ~ ~ #item:container run summon minecraft:area_effect_cloud ~.5 ~ ~.5 {Age: -2147483648, Duration: -1, WaitTime: -2147483648, Tags: ["container"]}
+execute if score #container.got mem matches 0 positioned ~ ~ ~-1 align xyz store success score #container.got mem unless entity @e[tag=container,dx=0,dy=0,dz=0] if block ~ ~ ~ #item:container run summon minecraft:area_effect_cloud ~.5 ~ ~.5 {Age: -2147483648, Duration: -1, WaitTime: -2147483648, Tags: ["container"]}
+scoreboard players add #container.dist mem 1
+execute if score #container.got mem matches 0 if score #container.dist mem matches ..4 positioned ^ ^ ^1 run function item:container/placed/recu

+ 8 - 0
data/old/item/functions/disable_slot/check_slot.mcfunction

@@ -0,0 +1,8 @@
+# 第八格
+# 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
+
+# 第九格
+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
+
+# 清除临时物品
+clear @a red_dye{LockTempItem:1b}

+ 4 - 0
data/old/item/functions/disable_slot/disable_slot_7.mcfunction

@@ -0,0 +1,4 @@
+clear @s red_dye{LockItem:1b,LockSlot:7b}
+execute if data entity @s Inventory[{Slot:7b}] run scoreboard players set @s item_slot 7
+execute if data entity @s Inventory[{Slot:7b}] at @s run function item:pop_slot/return_item
+replaceitem entity @s hotbar.7 red_dye{LockItem:1b,LockSlot:7b,display:{Name:'{"text":"已锁定","color":"red","italic":false}'}}

+ 4 - 0
data/old/item/functions/disable_slot/disable_slot_8.mcfunction

@@ -0,0 +1,4 @@
+clear @s red_dye{LockItem:1b,LockSlot:8b}
+execute if data entity @s Inventory[{Slot:8b}] run scoreboard players set @s item_slot 8
+execute if data entity @s Inventory[{Slot:8b}] at @s run function item:pop_slot/return_item
+replaceitem entity @s hotbar.8 red_dye{LockItem:1b,LockSlot:8b,display:{Name:'{"text":"已锁定","color":"red","italic":false}'}}

+ 10 - 0
data/old/item/functions/disable_throw.mcfunction

@@ -0,0 +1,10 @@
+# 强制玩家捡起自己丢弃的物品,以物品为执行者
+# 更改 NBT
+data modify entity @s PickupDelay set value 0
+data modify entity @s Owner set from entity @s Thrower
+
+# 将物品传送给与丢弃者 UUID 相同的玩家
+execute store result score @s UUID run data get entity @s Thrower[0]
+tag @s add item_force_tp
+execute as @a if score @s UUID = @e[type=item,tag=item_force_tp,limit=1] UUID run tp @e[type=item,tag=item_force_tp] @s
+tag @s remove item_force_tp

+ 6 - 0
data/old/item/functions/init.mcfunction

@@ -0,0 +1,6 @@
+# 计分板初始化
+scoreboard objectives remove UUID
+scoreboard objectives add UUID dummy "UUID"
+
+scoreboard objectives remove item_slot
+scoreboard objectives add item_slot dummy "item_slot"

+ 17 - 0
data/old/item/functions/particle/show_particle.mcfunction

@@ -0,0 +1,17 @@
+# 播放玩家粒子效果
+execute as @a[scores={particle_type=1},gamemode=!spectator] at @s run particle composter ~ ~0.1 ~ 0.15 0 0.15 0.001 2 force @a
+execute as @a[scores={particle_type=2},gamemode=!spectator] at @s run particle dust 1 1 1 1.5 ~ ~0.1 ~ 0.15 0 0.15 0.001 2 force @a
+execute as @a[scores={particle_type=3},gamemode=!spectator] at @s run particle falling_water ~ ~0.1 ~ 0.15 0 0.15 0.001 3 force @a
+execute as @a[scores={particle_type=4},gamemode=!spectator] at @s run particle flame ~ ~0.1 ~ 0.15 0 0.15 0.001 2 force @a
+execute as @a[scores={particle_type=5},gamemode=!spectator] at @s run particle dust 10 10 10 1.5 ~ ~0.1 ~ 0.15 0 0.15 0.001 2 force @a
+execute as @a[scores={particle_type=6},gamemode=!spectator] at @s run particle soul_fire_flame ~ ~0.1 ~ 0.15 0 0.15 0.001 1 force @a
+execute as @a[scores={particle_type=6},gamemode=!spectator] at @s run particle flame ~ ~0.1 ~ 0.15 0 0.15 0.001 1 force @a
+
+# 播放展示用实体的粒子效果
+execute as @e[type=!player,tag=show_particle_1] at @s run particle composter ~ ~0.5 ~ 0.15 0.15 0.15 0.001 2 force @a
+execute as @e[type=!player,tag=show_particle_2] at @s run particle dust 1 1 1 1.5 ~ ~0.5 ~ 0.1 0.15 0.1 0.001 1 force @a
+execute as @e[type=!player,tag=show_particle_3] at @s run particle falling_water ~ ~0.8 ~ 0.2 0.15 0.2 0.001 3 force @a
+execute as @e[type=!player,tag=show_particle_4] at @s run particle flame ~ ~0.5 ~ 0.15 0.15 0.15 0.001 1 force @a
+execute as @e[type=!player,tag=show_particle_5] at @s run particle dust 10 10 10 1.5 ~ ~0.5 ~ 0.1 0.15 0.1 0.001 1 force @a
+execute as @e[type=!player,tag=show_particle_6] at @s run particle soul_fire_flame ~ ~0.5 ~ 0.1 0.15 0.1 0.001 1 force @a
+execute as @e[type=!player,tag=show_particle_6] at @s run particle flame ~ ~0.5 ~ 0.1 0.15 0.1 0.001 1 force @a

+ 85 - 0
data/old/item/functions/pop_slot/pop_all.mcfunction

@@ -0,0 +1,85 @@
+scoreboard players set @s item_slot 0
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 1
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 2
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 3
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 4
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 5
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 6
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 7
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 8
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 9
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 10
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 11
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 12
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 13
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 14
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 15
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 16
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 17
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 18
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 19
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 20
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 21
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 22
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 23
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 24
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 25
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 26
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 27
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 28
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 29
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 30
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 31
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 32
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 33
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 34
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 35
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 100
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 101
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 102
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot 103
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+scoreboard players set @s item_slot -106
+execute at @s positioned ~ ~ ~ run function item:pop_slot/pop_item
+give @s dead_bush 2304
+replaceitem entity @s weapon.offhand dead_bush 64
+replaceitem entity @s armor.head dead_bush 64

+ 9 - 0
data/old/item/functions/pop_slot/pop_item.mcfunction

@@ -0,0 +1,9 @@
+summon item ~ ~ ~ {Item:{id:"minecraft:red_dye",Count:1b,tag:{LockTempItem:1b,display:{Name:'{"text":"非法物品","color":"red"}'}}},Tags:["LockTempItem","PopItem"]}
+function item:pop_slot/select_item
+kill @e[type=item,nbt={Item:{id:"minecraft:red_dye"}},tag=LockTempItem]
+# 不返还奇怪的东西
+kill @e[type=item,nbt={Item:{tag:{game_item:1b}}}]
+kill @e[type=item,nbt={Item:{tag:{lobby_item:1b}}}]
+kill @e[type=item,nbt={Item:{tag:{LockItem:1b}}}]
+data modify entity @e[type=item,tag=LockTempItem,limit=1] Thrower set from entity @s UUID
+tag @e[type=item,tag=LockTempItem] remove LockTempItem

+ 10 - 0
data/old/item/functions/pop_slot/return_item.mcfunction

@@ -0,0 +1,10 @@
+summon item ~ ~ ~ {Item:{id:"minecraft:red_dye",Count:1b,tag:{LockTempItem:1b,display:{Name:'{"text":"非法物品","color":"red"}'}}},Tags:["LockTempItem","ReturnItem"]}
+function item:pop_slot/select_item
+kill @e[type=item,nbt={Item:{id:"minecraft:red_dye"}},tag=LockTempItem]
+# 不返还奇怪的东西
+kill @e[type=item,nbt={Item:{tag:{game_item:1b}}}]
+kill @e[type=item,nbt={Item:{tag:{lobby_item:1b}}}]
+kill @e[type=item,nbt={Item:{tag:{LockItem:1b}}}]
+data modify entity @e[type=item,tag=LockTempItem,limit=1] Thrower set from entity @s UUID
+execute as @e[type=item,tag=LockTempItem,limit=1] run function item:disable_throw
+tag @e[type=item,tag=LockTempItem] remove LockTempItem

+ 85 - 0
data/old/item/functions/pop_slot/select_item.mcfunction

@@ -0,0 +1,85 @@
+execute if score @s item_slot matches 0 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:0b}]
+execute if score @s item_slot matches 1 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:1b}]
+execute if score @s item_slot matches 2 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:2b}]
+execute if score @s item_slot matches 3 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:3b}]
+execute if score @s item_slot matches 4 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:4b}]
+execute if score @s item_slot matches 5 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:5b}]
+execute if score @s item_slot matches 6 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:6b}]
+execute if score @s item_slot matches 7 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:7b}]
+execute if score @s item_slot matches 8 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:8b}]
+execute if score @s item_slot matches 9 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:9b}]
+execute if score @s item_slot matches 10 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:10b}]
+execute if score @s item_slot matches 11 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:11b}]
+execute if score @s item_slot matches 12 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:12b}]
+execute if score @s item_slot matches 13 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:13b}]
+execute if score @s item_slot matches 14 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:14b}]
+execute if score @s item_slot matches 15 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:15b}]
+execute if score @s item_slot matches 16 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:16b}]
+execute if score @s item_slot matches 17 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:17b}]
+execute if score @s item_slot matches 18 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:18b}]
+execute if score @s item_slot matches 19 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:19b}]
+execute if score @s item_slot matches 20 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:20b}]
+execute if score @s item_slot matches 21 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:21b}]
+execute if score @s item_slot matches 22 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:22b}]
+execute if score @s item_slot matches 23 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:23b}]
+execute if score @s item_slot matches 24 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:24b}]
+execute if score @s item_slot matches 25 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:25b}]
+execute if score @s item_slot matches 26 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:26b}]
+execute if score @s item_slot matches 27 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:27b}]
+execute if score @s item_slot matches 28 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:28b}]
+execute if score @s item_slot matches 29 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:29b}]
+execute if score @s item_slot matches 30 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:30b}]
+execute if score @s item_slot matches 31 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:31b}]
+execute if score @s item_slot matches 32 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:32b}]
+execute if score @s item_slot matches 33 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:33b}]
+execute if score @s item_slot matches 34 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:34b}]
+execute if score @s item_slot matches 35 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:35b}]
+execute if score @s item_slot matches 100 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:100b}]
+execute if score @s item_slot matches 101 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:101b}]
+execute if score @s item_slot matches 102 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:102b}]
+execute if score @s item_slot matches 103 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:103b}]
+execute if score @s item_slot matches -106 run data modify entity @e[type=item,tag=LockTempItem,limit=1] Item set from entity @s Inventory[{Slot:-106b}]
+
+execute if score @s item_slot matches 0 run replaceitem entity @s hotbar.0 air
+execute if score @s item_slot matches 1 run replaceitem entity @s hotbar.1 air
+execute if score @s item_slot matches 2 run replaceitem entity @s hotbar.2 air
+execute if score @s item_slot matches 3 run replaceitem entity @s hotbar.3 air
+execute if score @s item_slot matches 4 run replaceitem entity @s hotbar.4 air
+execute if score @s item_slot matches 5 run replaceitem entity @s hotbar.5 air
+execute if score @s item_slot matches 6 run replaceitem entity @s hotbar.6 air
+execute if score @s item_slot matches 7 run replaceitem entity @s hotbar.7 air
+execute if score @s item_slot matches 8 run replaceitem entity @s hotbar.8 air
+execute if score @s item_slot matches 9 run replaceitem entity @s inventory.0 air
+execute if score @s item_slot matches 10 run replaceitem entity @s inventory.1 air
+execute if score @s item_slot matches 11 run replaceitem entity @s inventory.2 air
+execute if score @s item_slot matches 12 run replaceitem entity @s inventory.3 air
+execute if score @s item_slot matches 13 run replaceitem entity @s inventory.4 air
+execute if score @s item_slot matches 14 run replaceitem entity @s inventory.5 air
+execute if score @s item_slot matches 15 run replaceitem entity @s inventory.6 air
+execute if score @s item_slot matches 16 run replaceitem entity @s inventory.7 air
+execute if score @s item_slot matches 17 run replaceitem entity @s inventory.8 air
+execute if score @s item_slot matches 18 run replaceitem entity @s inventory.9 air
+execute if score @s item_slot matches 19 run replaceitem entity @s inventory.10 air
+execute if score @s item_slot matches 20 run replaceitem entity @s inventory.11 air
+execute if score @s item_slot matches 21 run replaceitem entity @s inventory.12 air
+execute if score @s item_slot matches 22 run replaceitem entity @s inventory.13 air
+execute if score @s item_slot matches 23 run replaceitem entity @s inventory.14 air
+execute if score @s item_slot matches 24 run replaceitem entity @s inventory.15 air
+execute if score @s item_slot matches 25 run replaceitem entity @s inventory.16 air
+execute if score @s item_slot matches 26 run replaceitem entity @s inventory.17 air
+execute if score @s item_slot matches 27 run replaceitem entity @s inventory.18 air
+execute if score @s item_slot matches 28 run replaceitem entity @s inventory.19 air
+execute if score @s item_slot matches 29 run replaceitem entity @s inventory.20 air
+execute if score @s item_slot matches 30 run replaceitem entity @s inventory.21 air
+execute if score @s item_slot matches 31 run replaceitem entity @s inventory.22 air
+execute if score @s item_slot matches 32 run replaceitem entity @s inventory.23 air
+execute if score @s item_slot matches 33 run replaceitem entity @s inventory.24 air
+execute if score @s item_slot matches 34 run replaceitem entity @s inventory.25 air
+execute if score @s item_slot matches 35 run replaceitem entity @s inventory.26 air
+execute if score @s item_slot matches 100 run replaceitem entity @s armor.feet air
+execute if score @s item_slot matches 101 run replaceitem entity @s armor.legs air
+execute if score @s item_slot matches 102 run replaceitem entity @s armor.chest air
+execute if score @s item_slot matches 103 run replaceitem entity @s armor.head air
+execute if score @s item_slot matches -106 run replaceitem entity @s weapon.offhand air
+
+scoreboard players reset @s item_slot

+ 16 - 0
data/old/item/functions/shop/buy_apple1.mcfunction

@@ -0,0 +1,16 @@
+# 生命果 (4 gi)
+# 触发器ID 1
+execute unless entity @s[scores={shop_apple=0..}] run scoreboard players set @s shop_apple 0
+tag @s remove canbuy
+tag @s[scores={shop_apple=0,gold=36..}] add canbuy
+tellraw @s[scores={shop_apple=1..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
+tellraw @s[scores={shop_apple=0,gold=..35}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金锭来购买这个物品!","color":"red"}]
+tellraw @s[scores={shop_apple=..-1}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先购买上一级的物品!","color":"red"}]
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"生命果","color":"green"}]
+execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 购买了 ",{"text":"生命果","color":"green"}]
+scoreboard players add @s[tag=canbuy] shop_apple 1
+scoreboard players remove @s[tag=canbuy] gold 36
+execute as @s[tag=!canbuy] at @s run function lib:sounds/error
+execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
+execute as @s[tag=canbuy] run function item:shop/refresh_gold
+tag @s remove canbuy

+ 16 - 0
data/old/item/functions/shop/buy_apple2.mcfunction

@@ -0,0 +1,16 @@
+# 附魔生命果 (1 gb)
+# 触发器ID 2
+execute unless entity @s[scores={shop_apple=0..}] run scoreboard players set @s shop_apple 0
+tag @s remove canbuy
+tag @s[scores={shop_apple=1,gold=81..}] add canbuy
+tellraw @s[scores={shop_apple=2..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
+tellraw @s[scores={shop_apple=1,gold=..80}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金块来购买这个物品!","color":"red"}]
+tellraw @s[scores={shop_apple=..0}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先购买上一级的物品!","color":"red"}]
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"附魔生命果","color":"green"}]
+execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 购买了 ",{"text":"附魔生命果","color":"green"}]
+scoreboard players add @s[tag=canbuy] shop_apple 1
+scoreboard players remove @s[tag=canbuy] gold 81
+execute as @s[tag=!canbuy] at @s run function lib:sounds/error
+execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
+execute as @s[tag=canbuy] run function item:shop/refresh_gold
+tag @s remove canbuy

+ 16 - 0
data/old/item/functions/shop/buy_armor1.mcfunction

@@ -0,0 +1,16 @@
+# 金靴子 (4 gi)
+# 触发器ID 3
+execute unless entity @s[scores={shop_armor=0..}] run scoreboard players set @s shop_armor 0
+tag @s remove canbuy
+tag @s[scores={shop_armor=0,gold=36..}] add canbuy
+tellraw @s[scores={shop_armor=1..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
+tellraw @s[scores={shop_armor=0,gold=..35}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金锭来购买这个物品!","color":"red"}]
+tellraw @s[scores={shop_armor=..-1}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先购买上一级的物品!","color":"red"}]
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"金靴子","color":"green"}]
+execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 购买了 ",{"text":"金靴子","color":"green"}]
+scoreboard players add @s[tag=canbuy] shop_armor 1
+scoreboard players remove @s[tag=canbuy] gold 36
+execute as @s[tag=!canbuy] at @s run function lib:sounds/error
+execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
+execute as @s[tag=canbuy] run function item:shop/refresh_gold
+tag @s remove canbuy

+ 16 - 0
data/old/item/functions/shop/buy_armor2.mcfunction

@@ -0,0 +1,16 @@
+# 金护腿 (1 gb)
+# 触发器ID 5
+execute unless entity @s[scores={shop_armor=0..}] run scoreboard players set @s shop_armor 0
+tag @s remove canbuy
+tag @s[scores={shop_armor=1,gold=81..}] add canbuy
+tellraw @s[scores={shop_armor=2..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
+tellraw @s[scores={shop_armor=1,gold=..80}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金块来购买这个物品!","color":"red"}]
+tellraw @s[scores={shop_armor=..0}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先购买上一级的物品!","color":"red"}]
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"金护腿","color":"green"}]
+execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 购买了 ",{"text":"金护腿","color":"green"}]
+scoreboard players add @s[tag=canbuy] shop_armor 1
+scoreboard players remove @s[tag=canbuy] gold 81
+execute as @s[tag=!canbuy] at @s run function lib:sounds/error
+execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
+execute as @s[tag=canbuy] run function item:shop/refresh_gold
+tag @s remove canbuy

+ 16 - 0
data/old/item/functions/shop/buy_armor3.mcfunction

@@ -0,0 +1,16 @@
+# 金胸甲 (3 gb)
+# 触发器ID 6
+execute unless entity @s[scores={shop_armor=0..}] run scoreboard players set @s shop_armor 0
+tag @s remove canbuy
+tag @s[scores={shop_armor=2,gold=243..}] add canbuy
+tellraw @s[scores={shop_armor=3..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
+tellraw @s[scores={shop_armor=2,gold=..242}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金块来购买这个物品!","color":"red"}]
+tellraw @s[scores={shop_armor=..1}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先购买上一级的物品!","color":"red"}]
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"金胸甲","color":"green"}]
+execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 购买了 ",{"text":"金胸甲","color":"green"}]
+scoreboard players add @s[tag=canbuy] shop_armor 1
+scoreboard players remove @s[tag=canbuy] gold 243
+execute as @s[tag=!canbuy] at @s run function lib:sounds/error
+execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
+execute as @s[tag=canbuy] run function item:shop/refresh_gold
+tag @s remove canbuy

+ 16 - 0
data/old/item/functions/shop/buy_arrow1.mcfunction

@@ -0,0 +1,16 @@
+# 箭 (1 gi)
+# 触发器ID 7
+execute unless entity @s[scores={shop_arrow=0..}] run scoreboard players set @s shop_arrow 0
+tag @s remove canbuy
+tag @s[scores={shop_arrow=0,gold=9..}] add canbuy
+tellraw @s[scores={shop_arrow=1..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
+tellraw @s[scores={shop_arrow=0,gold=..8}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金锭来购买这个物品!","color":"red"}]
+tellraw @s[scores={shop_arrow=..-1}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先购买上一级的物品!","color":"red"}]
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"箭","color":"green"}]
+execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 购买了 ",{"text":"箭","color":"green"}]
+scoreboard players add @s[tag=canbuy] shop_arrow 1
+scoreboard players remove @s[tag=canbuy] gold 9
+execute as @s[tag=!canbuy] at @s run function lib:sounds/error
+execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
+execute as @s[tag=canbuy] run function item:shop/refresh_gold
+tag @s remove canbuy

+ 16 - 0
data/old/item/functions/shop/buy_arrow2.mcfunction

@@ -0,0 +1,16 @@
+# 箭 x2 (4 gi)
+# 触发器ID 8
+execute unless entity @s[scores={shop_arrow=0..}] run scoreboard players set @s shop_arrow 0
+tag @s remove canbuy
+tag @s[scores={shop_arrow=1,gold=36..}] add canbuy
+tellraw @s[scores={shop_arrow=2..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
+tellraw @s[scores={shop_arrow=1,gold=..35}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金锭来购买这个物品!","color":"red"}]
+tellraw @s[scores={shop_arrow=..0}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先购买上一级的物品!","color":"red"}]
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"箭 x2","color":"green"}]
+execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 购买了 ",{"text":"箭 x2","color":"green"}]
+scoreboard players add @s[tag=canbuy] shop_arrow 1
+scoreboard players remove @s[tag=canbuy] gold 36
+execute as @s[tag=!canbuy] at @s run function lib:sounds/error
+execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
+execute as @s[tag=canbuy] run function item:shop/refresh_gold
+tag @s remove canbuy

+ 16 - 0
data/old/item/functions/shop/buy_arrow3.mcfunction

@@ -0,0 +1,16 @@
+# 缓慢之箭 x2 (1 gb)
+# 触发器ID 9
+execute unless entity @s[scores={shop_arrow=0..}] run scoreboard players set @s shop_arrow 0
+tag @s remove canbuy
+tag @s[scores={shop_arrow=2,gold=81..}] add canbuy
+tellraw @s[scores={shop_arrow=3..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
+tellraw @s[scores={shop_arrow=2,gold=..80}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金块来购买这个物品!","color":"red"}]
+tellraw @s[scores={shop_arrow=..1}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先购买上一级的物品!","color":"red"}]
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"缓慢之箭 x2","color":"green"}]
+execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 购买了 ",{"text":"缓慢之箭 x2","color":"green"}]
+scoreboard players add @s[tag=canbuy] shop_arrow 1
+scoreboard players remove @s[tag=canbuy] gold 81
+execute as @s[tag=!canbuy] at @s run function lib:sounds/error
+execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
+execute as @s[tag=canbuy] run function item:shop/refresh_gold
+tag @s remove canbuy

+ 16 - 0
data/old/item/functions/shop/buy_bgm.mcfunction

@@ -0,0 +1,16 @@
+# 老板换碟 (1 gi)
+# 触发器ID 20
+execute unless entity @s[scores={shop_bgm=0..}] run scoreboard players set @s shop_bgm 0
+tag @s remove canbuy
+tag @s[scores={shop_bgm=0,gold=9..}] add canbuy
+tellraw @s[scores={shop_bgm=1..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
+tellraw @s[scores={shop_bgm=0,gold=..8}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金锭来购买这个物品!","color":"red"}]
+tellraw @s[scores={shop_bgm=..-1}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先购买上一级的物品!","color":"red"}]
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"老板换碟","color":"green"}]
+execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 购买了 ",{"text":"老板换碟","color":"green"}]
+execute as @s[tag=canbuy] run function item:shop/special_bgm
+scoreboard players remove @s[tag=canbuy] gold 9
+execute as @s[tag=!canbuy] at @s run function lib:sounds/error
+execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
+execute as @s[tag=canbuy] run function item:shop/refresh_gold
+tag @s remove canbuy

+ 16 - 0
data/old/item/functions/shop/buy_bow.mcfunction

@@ -0,0 +1,16 @@
+# 破损的弓 (1 gb)
+# 触发器ID 15
+execute unless entity @s[scores={shop_bow=0..}] run scoreboard players set @s shop_bow 0
+tag @s remove canbuy
+tag @s[scores={shop_bow=0,gold=81..}] add canbuy
+tellraw @s[scores={shop_bow=1..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
+tellraw @s[scores={shop_bow=0,gold=..80}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金块来购买这个物品!","color":"red"}]
+tellraw @s[scores={shop_bow=..-1}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先购买上一级的物品!","color":"red"}]
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"破损的弓","color":"green"}]
+execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 购买了 ",{"text":"破损的弓","color":"green"}]
+scoreboard players add @s[tag=canbuy] shop_bow 1
+scoreboard players remove @s[tag=canbuy] gold 81
+execute as @s[tag=!canbuy] at @s run function lib:sounds/error
+execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
+execute as @s[tag=canbuy] run function item:shop/refresh_gold
+tag @s remove canbuy

+ 15 - 0
data/old/item/functions/shop/buy_dice.mcfunction

@@ -0,0 +1,15 @@
+# 骰子 (1 gi)
+# 触发器ID 999
+execute unless entity @s[scores={shop_dice=0..}] run scoreboard players set @s shop_dice 0
+tag @s remove canbuy
+tag @s[scores={shop_dice=0,gold=9..}] add canbuy
+tellraw @s[scores={shop_dice=1..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购赌了这个骰子了!","color":"aqua"}]
+tellraw @s[scores={shop_dice=0,gold=..8}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金粒来赌骰子!","color":"red"}]
+tellraw @s[scores={shop_dice=..-1}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先赌上一级的骰子!","color":"red"}]
+# tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你赌了一次 ",{"text":"20面骰子","color":"green"}]
+# execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 赌了一次 ",{"text":"20面骰子","color":"green"}]
+execute as @s[tag=canbuy] run function ltw:state/0/roll_dice/roll
+scoreboard players remove @s[tag=canbuy] gold 9
+execute as @s[tag=!canbuy] at @s run function lib:sounds/error
+execute as @s[tag=canbuy] run function item:shop/refresh_gold
+tag @s remove canbuy

+ 16 - 0
data/old/item/functions/shop/buy_easter_egg.mcfunction

@@ -0,0 +1,16 @@
+# 臭彩蛋 (1 gn)
+# 触发器ID 114514
+execute unless entity @s[scores={shop_easter_egg=0..}] run scoreboard players set @s shop_easter_egg 0
+tag @s remove canbuy
+tag @s[scores={shop_easter_egg=0,gold=1..}] add canbuy
+tellraw @s[scores={shop_easter_egg=1..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
+tellraw @s[scores={shop_easter_egg=0,gold=..0}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金粒来购买这个物品!","color":"red"}]
+tellraw @s[scores={shop_easter_egg=..-1}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先购买上一级的物品!","color":"red"}]
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"臭彩蛋","color":"green"}]
+execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 购买了 ",{"text":"臭彩蛋","color":"green"}]
+execute as @s[tag=canbuy] run function item:shop/special_easter_egg
+scoreboard players remove @s[tag=canbuy] gold 1
+execute as @s[tag=!canbuy] at @s run function lib:sounds/error
+execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
+execute as @s[tag=canbuy] run function item:shop/refresh_gold
+tag @s remove canbuy

+ 16 - 0
data/old/item/functions/shop/buy_firework.mcfunction

@@ -0,0 +1,16 @@
+# 漂亮的烟花 (1 gb)
+# 触发器ID 19
+execute unless entity @s[scores={shop_firework=0..}] run scoreboard players set @s shop_firework 0
+tag @s remove canbuy
+tag @s[scores={shop_firework=0,gold=81..}] add canbuy
+tellraw @s[scores={shop_firework=1..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
+tellraw @s[scores={shop_firework=0,gold=..80}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金块来购买这个物品!","color":"red"}]
+tellraw @s[scores={shop_firework=..-1}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先购买上一级的物品!","color":"red"}]
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"漂亮的烟花","color":"green"}]
+execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 购买了 ",{"text":"漂亮的烟花","color":"green"}]
+scoreboard players add @s[tag=canbuy] shop_firework 1
+scoreboard players remove @s[tag=canbuy] gold 81
+execute as @s[tag=!canbuy] at @s run function lib:sounds/error
+execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
+execute as @s[tag=canbuy] run function item:shop/refresh_gold
+tag @s remove canbuy

+ 16 - 0
data/old/item/functions/shop/buy_orange.mcfunction

@@ -0,0 +1,16 @@
+# 活跃橙 (3 gb)
+# 触发器ID 10
+execute unless entity @s[scores={shop_orange=0..}] run scoreboard players set @s shop_orange 0
+tag @s remove canbuy
+tag @s[scores={shop_orange=0,gold=243..}] add canbuy
+tellraw @s[scores={shop_orange=1..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
+tellraw @s[scores={shop_orange=0,gold=..242}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金块来购买这个物品!","color":"red"}]
+tellraw @s[scores={shop_orange=..-1}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先购买上一级的物品!","color":"red"}]
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"活跃橙","color":"green"},", 请私聊龙猫 PCL2 识别码领取!"]
+execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 购买了 ",{"text":"活跃橙","color":"green"}]
+scoreboard players add @s[tag=canbuy] shop_orange 1
+scoreboard players remove @s[tag=canbuy] gold 243
+execute as @s[tag=!canbuy] at @s run function lib:sounds/error
+execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
+execute as @s[tag=canbuy] run function item:shop/refresh_gold
+tag @s remove canbuy

+ 11 - 0
data/old/item/functions/shop/buy_particle0.mcfunction

@@ -0,0 +1,11 @@
+# 关闭粒子 (0 e)
+# 触发器ID 102
+execute unless entity @s[scores={shop_particle_s=0..}] run scoreboard players set @s shop_particle_s 0
+
+tellraw @s[scores={shop_particle_s=0}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先在左侧购买尾迹特效才能切换尾迹种类!","color":"red"}]
+execute as @s[scores={shop_particle_s=0}] at @s run function lib:sounds/error
+
+tellraw @s[scores={shop_particle_s=1..}] ["",{"text":">> ","color":"green","bold":true},"尾迹特效已 ",{"text":"关闭","color":"green"}]
+execute as @s[scores={shop_particle_s=1..}] at @s run function lib:sounds/hit
+
+scoreboard players set @s particle_type 0

+ 11 - 0
data/old/item/functions/shop/buy_particle1.mcfunction

@@ -0,0 +1,11 @@
+# 绿光粒子 (0 e)
+# 触发器ID 103
+execute unless entity @s[scores={shop_particle_s=0..}] run scoreboard players set @s shop_particle_s 0
+
+tellraw @s[scores={shop_particle_s=0}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先在左侧购买尾迹特效才能切换尾迹种类!","color":"red"}]
+execute as @s[scores={shop_particle_s=0}] at @s run function lib:sounds/error
+
+tellraw @s[scores={shop_particle_s=1..}] ["",{"text":">> ","color":"green","bold":true},"尾迹特效已切换为 ",{"text":"绿光","color":"green"}]
+execute as @s[scores={shop_particle_s=1..}] at @s run function lib:sounds/hit
+
+scoreboard players set @s[scores={shop_particle_s=1..}] particle_type 1

+ 25 - 0
data/old/item/functions/shop/buy_particle2.mcfunction

@@ -0,0 +1,25 @@
+# 素雅粒子 (3 e)
+# 触发器ID 104
+execute unless entity @s[scores={shop_particle_s=0..}] run scoreboard players set @s shop_particle_s 0
+execute unless entity @s[scores={shop_particle_2=0..}] run scoreboard players set @s shop_particle_2 0
+tag @s remove canbuy
+tag @s[scores={shop_particle_s=1..,shop_particle_2=0,green=3..}] add canbuy
+
+tellraw @s[scores={shop_particle_s=0}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先在左侧购买尾迹特效才能切换尾迹种类!","color":"red"}]
+execute as @s[scores={shop_particle_s=0}] at @s run function lib:sounds/error
+
+tellraw @s[scores={shop_particle_s=1..,shop_particle_2=1..}] ["",{"text":">> ","color":"green","bold":true},"尾迹特效已切换为 ",{"text":"素雅","color":"green"}]
+execute as @s[scores={shop_particle_s=1..,shop_particle_2=1..}] at @s run function lib:sounds/hit
+
+tellraw @s[scores={shop_particle_s=1..,shop_particle_2=0,green=..2}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的绿宝石来购买它!","color":"red"}]
+execute as @s[scores={shop_particle_s=1..,shop_particle_2=0,green=..2}] at @s run function lib:sounds/error
+
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你已购买并切换尾迹特效为 ",{"text":"素雅","color":"green"}]
+execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 购买了 ",{"text":"素雅尾迹","color":"green"}]
+scoreboard players add @s[tag=canbuy] shop_particle_2 1
+scoreboard players remove @s[tag=canbuy] green 3
+execute as @s[tag=canbuy] run function item:shop/refresh_green
+execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
+tag @s remove canbuy
+
+scoreboard players set @s[scores={shop_particle_2=1..}] particle_type 2

+ 25 - 0
data/old/item/functions/shop/buy_particle3.mcfunction

@@ -0,0 +1,25 @@
+# 水滴粒子 (3 e)
+# 触发器ID 105
+execute unless entity @s[scores={shop_particle_s=0..}] run scoreboard players set @s shop_particle_s 0
+execute unless entity @s[scores={shop_particle_3=0..}] run scoreboard players set @s shop_particle_3 0
+tag @s remove canbuy
+tag @s[scores={shop_particle_s=1..,shop_particle_3=0,green=3..}] add canbuy
+
+tellraw @s[scores={shop_particle_s=0}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先在左侧购买尾迹特效才能切换尾迹种类!","color":"red"}]
+execute as @s[scores={shop_particle_s=0}] at @s run function lib:sounds/error
+
+tellraw @s[scores={shop_particle_s=1..,shop_particle_3=1..}] ["",{"text":">> ","color":"green","bold":true},"尾迹特效已切换为 ",{"text":"水滴","color":"green"}]
+execute as @s[scores={shop_particle_s=1..,shop_particle_3=1..}] at @s run function lib:sounds/hit
+
+tellraw @s[scores={shop_particle_s=1..,shop_particle_3=0,green=..2}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的绿宝石来购买它!","color":"red"}]
+execute as @s[scores={shop_particle_s=1..,shop_particle_3=0,green=..2}] at @s run function lib:sounds/error
+
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你已购买并切换尾迹特效为 ",{"text":"水滴","color":"green"}]
+execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 购买了 ",{"text":"水滴尾迹","color":"green"}]
+scoreboard players add @s[tag=canbuy] shop_particle_3 1
+scoreboard players remove @s[tag=canbuy] green 3
+execute as @s[tag=canbuy] run function item:shop/refresh_green
+execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
+tag @s remove canbuy
+
+scoreboard players set @s[scores={shop_particle_3=1..}] particle_type 3

+ 25 - 0
data/old/item/functions/shop/buy_particle4.mcfunction

@@ -0,0 +1,25 @@
+# 烈焰粒子 (6 e)
+# 触发器ID 106
+execute unless entity @s[scores={shop_particle_s=0..}] run scoreboard players set @s shop_particle_s 0
+execute unless entity @s[scores={shop_particle_4=0..}] run scoreboard players set @s shop_particle_4 0
+tag @s remove canbuy
+tag @s[scores={shop_particle_s=1..,shop_particle_4=0,green=6..}] add canbuy
+
+tellraw @s[scores={shop_particle_s=0}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先在左侧购买尾迹特效才能切换尾迹种类!","color":"red"}]
+execute as @s[scores={shop_particle_s=0}] at @s run function lib:sounds/error
+
+tellraw @s[scores={shop_particle_s=1..,shop_particle_4=1..}] ["",{"text":">> ","color":"green","bold":true},"尾迹特效已切换为 ",{"text":"烈焰","color":"green"}]
+execute as @s[scores={shop_particle_s=1..,shop_particle_4=1..}] at @s run function lib:sounds/hit
+
+tellraw @s[scores={shop_particle_s=1..,shop_particle_4=0,green=..5}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的绿宝石来购买它!","color":"red"}]
+execute as @s[scores={shop_particle_s=1..,shop_particle_4=0,green=..5}] at @s run function lib:sounds/error
+
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你已购买并切换尾迹特效为 ",{"text":"烈焰","color":"green"}]
+execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 购买了 ",{"text":"烈焰尾迹","color":"green"}]
+scoreboard players add @s[tag=canbuy] shop_particle_4 1
+scoreboard players remove @s[tag=canbuy] green 6
+execute as @s[tag=canbuy] run function item:shop/refresh_green
+execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
+tag @s remove canbuy
+
+scoreboard players set @s[scores={shop_particle_4=1..}] particle_type 4

+ 25 - 0
data/old/item/functions/shop/buy_particle5.mcfunction

@@ -0,0 +1,25 @@
+# 炫彩粒子 (6 e)
+# 触发器ID 107
+execute unless entity @s[scores={shop_particle_s=0..}] run scoreboard players set @s shop_particle_s 0
+execute unless entity @s[scores={shop_particle_5=0..}] run scoreboard players set @s shop_particle_5 0
+tag @s remove canbuy
+tag @s[scores={shop_particle_s=1..,shop_particle_5=0,green=6..}] add canbuy
+
+tellraw @s[scores={shop_particle_s=0}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先在左侧购买尾迹特效才能切换尾迹种类!","color":"red"}]
+execute as @s[scores={shop_particle_s=0}] at @s run function lib:sounds/error
+
+tellraw @s[scores={shop_particle_s=1..,shop_particle_5=1..}] ["",{"text":">> ","color":"green","bold":true},"尾迹特效已切换为 ",{"text":"炫彩","color":"green"}]
+execute as @s[scores={shop_particle_s=1..,shop_particle_5=1..}] at @s run function lib:sounds/hit
+
+tellraw @s[scores={shop_particle_s=1..,shop_particle_5=0,green=..5}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的绿宝石来购买它!","color":"red"}]
+execute as @s[scores={shop_particle_s=1..,shop_particle_5=0,green=..5}] at @s run function lib:sounds/error
+
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你已购买并切换尾迹特效为 ",{"text":"炫彩","color":"green"}]
+execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 购买了 ",{"text":"炫彩尾迹","color":"green"}]
+scoreboard players add @s[tag=canbuy] shop_particle_5 1
+scoreboard players remove @s[tag=canbuy] green 6
+execute as @s[tag=canbuy] run function item:shop/refresh_green
+execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
+tag @s remove canbuy
+
+scoreboard players set @s[scores={shop_particle_5=1..}] particle_type 5

+ 25 - 0
data/old/item/functions/shop/buy_particle6.mcfunction

@@ -0,0 +1,25 @@
+# 魂焰粒子 (1 eb)
+# 触发器ID 108
+execute unless entity @s[scores={shop_particle_s=0..}] run scoreboard players set @s shop_particle_s 0
+execute unless entity @s[scores={shop_particle_6=0..}] run scoreboard players set @s shop_particle_6 0
+tag @s remove canbuy
+tag @s[scores={shop_particle_s=1..,shop_particle_6=0,green=9..}] add canbuy
+
+tellraw @s[scores={shop_particle_s=0}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先在左侧购买尾迹特效才能切换尾迹种类!","color":"red"}]
+execute as @s[scores={shop_particle_s=0}] at @s run function lib:sounds/error
+
+tellraw @s[scores={shop_particle_s=1..,shop_particle_6=1..}] ["",{"text":">> ","color":"green","bold":true},"尾迹特效已切换为 ",{"text":"魂焰","color":"green"}]
+execute as @s[scores={shop_particle_s=1..,shop_particle_6=1..}] at @s run function lib:sounds/hit
+
+tellraw @s[scores={shop_particle_s=1..,shop_particle_6=0,green=..8}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的绿宝石块来购买它!","color":"red"}]
+execute as @s[scores={shop_particle_s=1..,shop_particle_6=0,green=..8}] at @s run function lib:sounds/error
+
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你已购买并切换尾迹特效为 ",{"text":"魂焰","color":"green"}]
+execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 购买了 ",{"text":"魂焰尾迹","color":"green"}]
+scoreboard players add @s[tag=canbuy] shop_particle_6 1
+scoreboard players remove @s[tag=canbuy] green 9
+execute as @s[tag=canbuy] run function item:shop/refresh_green
+execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
+tag @s remove canbuy
+
+scoreboard players set @s[scores={shop_particle_6=1..}] particle_type 6

+ 17 - 0
data/old/item/functions/shop/buy_particle_system.mcfunction

@@ -0,0 +1,17 @@
+# 粒子系统 (2 eb)
+# 触发器ID 100
+execute unless entity @s[scores={shop_particle_s=0..}] run scoreboard players set @s shop_particle_s 0
+tag @s remove canbuy
+tag @s[scores={shop_particle_s=0,green=18..}] add canbuy
+
+tellraw @s[scores={shop_particle_s=1..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了尾迹特效了!","color":"aqua"}]
+tellraw @s[scores={shop_particle_s=0,green=..17}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的绿宝石块来购买它!","color":"red"}]
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"尾迹特效","color":"green"}]
+execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 购买了 ",{"text":"尾迹特效","color":"green"}]
+
+scoreboard players add @s[tag=canbuy] shop_particle_s 1
+scoreboard players remove @s[tag=canbuy] green 18
+execute as @s[tag=!canbuy] at @s run function lib:sounds/error
+execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
+execute as @s[tag=canbuy] run function item:shop/refresh_green
+tag @s remove canbuy

+ 15 - 0
data/old/item/functions/shop/buy_pig.mcfunction

@@ -0,0 +1,15 @@
+# 哼唧 (1 gn)
+# 触发器ID 21
+execute unless entity @s[scores={shop_pig=0..}] run scoreboard players set @s shop_pig 0
+tag @s remove canbuy
+tag @s[scores={shop_pig=0,gold=1..}] add canbuy
+tellraw @s[scores={shop_pig=1..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
+tellraw @s[scores={shop_pig=0,gold=..0}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金粒来购买这个物品!","color":"red"}]
+tellraw @s[scores={shop_pig=..-1}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先购买上一级的物品!","color":"red"}]
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"哼唧","color":"green"}]
+execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 购买了 ",{"text":"哼唧","color":"green"}]
+execute as @s[tag=canbuy] run function item:shop/special_pig
+scoreboard players remove @s[tag=canbuy] gold 1
+execute as @s[tag=!canbuy] at @s run function lib:sounds/error
+execute as @s[tag=canbuy] run function item:shop/refresh_gold
+tag @s remove canbuy

+ 16 - 0
data/old/item/functions/shop/buy_potion_resist.mcfunction

@@ -0,0 +1,16 @@
+# 抗性提升 (0:20) (1 gb)
+# 触发器ID 16
+execute unless entity @s[scores={shop_potion_rst=0..}] run scoreboard players set @s shop_potion_rst 0
+tag @s remove canbuy
+tag @s[scores={shop_potion_rst=0,gold=81..}] add canbuy
+tellraw @s[scores={shop_potion_rst=1..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
+tellraw @s[scores={shop_potion_rst=0,gold=..80}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金块来购买这个物品!","color":"red"}]
+tellraw @s[scores={shop_potion_rst=..-1}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先购买上一级的物品!","color":"red"}]
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"抗性提升 (0:20)","color":"green"}]
+execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 购买了 ",{"text":"抗性提升 (0:20)","color":"green"}]
+scoreboard players add @s[tag=canbuy] shop_potion_rst 1
+scoreboard players remove @s[tag=canbuy] gold 81
+execute as @s[tag=!canbuy] at @s run function lib:sounds/error
+execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
+execute as @s[tag=canbuy] run function item:shop/refresh_gold
+tag @s remove canbuy

+ 16 - 0
data/old/item/functions/shop/buy_potion_speed1.mcfunction

@@ -0,0 +1,16 @@
+# 速度 (0:15) (4 gi)
+# 触发器ID 17
+execute unless entity @s[scores={shop_potion_spd=0..}] run scoreboard players set @s shop_potion_spd 0
+tag @s remove canbuy
+tag @s[scores={shop_potion_spd=0,gold=36..}] add canbuy
+tellraw @s[scores={shop_potion_spd=1..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
+tellraw @s[scores={shop_potion_spd=0,gold=..35}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金锭来购买这个物品!","color":"red"}]
+tellraw @s[scores={shop_potion_spd=..-1}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先购买上一级的物品!","color":"red"}]
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"速度 (0:15)","color":"green"}]
+execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 购买了 ",{"text":"速度 (0:15)","color":"green"}]
+scoreboard players add @s[tag=canbuy] shop_potion_spd 1
+scoreboard players remove @s[tag=canbuy] gold 36
+execute as @s[tag=!canbuy] at @s run function lib:sounds/error
+execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
+execute as @s[tag=canbuy] run function item:shop/refresh_gold
+tag @s remove canbuy

+ 16 - 0
data/old/item/functions/shop/buy_potion_speed2.mcfunction

@@ -0,0 +1,16 @@
+# 速度 II (0:15) (1 gb)
+# 触发器ID 18
+execute unless entity @s[scores={shop_potion_spd=0..}] run scoreboard players set @s shop_potion_spd 0
+tag @s remove canbuy
+tag @s[scores={shop_potion_spd=1,gold=81..}] add canbuy
+tellraw @s[scores={shop_potion_spd=2..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
+tellraw @s[scores={shop_potion_spd=1,gold=..80}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金块来购买这个物品!","color":"red"}]
+tellraw @s[scores={shop_potion_spd=..0}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先购买上一级的物品!","color":"red"}]
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"速度 II (0:15)","color":"green"}]
+execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 购买了 ",{"text":"速度 II (0:15)","color":"green"}]
+scoreboard players add @s[tag=canbuy] shop_potion_spd 1
+scoreboard players remove @s[tag=canbuy] gold 81
+execute as @s[tag=!canbuy] at @s run function lib:sounds/error
+execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
+execute as @s[tag=canbuy] run function item:shop/refresh_gold
+tag @s remove canbuy

+ 16 - 0
data/old/item/functions/shop/buy_weapon1.mcfunction

@@ -0,0 +1,16 @@
+# 木锹 (1 gi)
+# 触发器ID 11
+execute unless entity @s[scores={shop_weapon=0..}] run scoreboard players set @s shop_weapon 0
+tag @s remove canbuy
+tag @s[scores={shop_weapon=0,gold=9..}] add canbuy
+tellraw @s[scores={shop_weapon=1..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
+tellraw @s[scores={shop_weapon=0,gold=..8}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金锭来购买这个物品!","color":"red"}]
+tellraw @s[scores={shop_weapon=..-1}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先购买上一级的物品!","color":"red"}]
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"木锹","color":"green"}]
+execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 购买了 ",{"text":"木锹","color":"green"}]
+scoreboard players add @s[tag=canbuy] shop_weapon 1
+scoreboard players remove @s[tag=canbuy] gold 9
+execute as @s[tag=!canbuy] at @s run function lib:sounds/error
+execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
+execute as @s[tag=canbuy] run function item:shop/refresh_gold
+tag @s remove canbuy

+ 16 - 0
data/old/item/functions/shop/buy_weapon2.mcfunction

@@ -0,0 +1,16 @@
+# 石锹 (4 gi)
+# 触发器ID 12
+execute unless entity @s[scores={shop_weapon=0..}] run scoreboard players set @s shop_weapon 0
+tag @s remove canbuy
+tag @s[scores={shop_weapon=1,gold=36..}] add canbuy
+tellraw @s[scores={shop_weapon=2..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
+tellraw @s[scores={shop_weapon=1,gold=..35}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金锭来购买这个物品!","color":"red"}]
+tellraw @s[scores={shop_weapon=..0}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先购买上一级的物品!","color":"red"}]
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"石锹","color":"green"}]
+execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 购买了 ",{"text":"石锹","color":"green"}]
+scoreboard players add @s[tag=canbuy] shop_weapon 1
+scoreboard players remove @s[tag=canbuy] gold 36
+execute as @s[tag=!canbuy] at @s run function lib:sounds/error
+execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
+execute as @s[tag=canbuy] run function item:shop/refresh_gold
+tag @s remove canbuy

+ 16 - 0
data/old/item/functions/shop/buy_weapon3.mcfunction

@@ -0,0 +1,16 @@
+# 铁锹 (1 gb)
+# 触发器ID 13
+execute unless entity @s[scores={shop_weapon=0..}] run scoreboard players set @s shop_weapon 0
+tag @s remove canbuy
+tag @s[scores={shop_weapon=2,gold=81..}] add canbuy
+tellraw @s[scores={shop_weapon=3..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
+tellraw @s[scores={shop_weapon=2,gold=..80}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金块来购买这个物品!","color":"red"}]
+tellraw @s[scores={shop_weapon=..1}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先购买上一级的物品!","color":"red"}]
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"铁锹","color":"green"}]
+execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 购买了 ",{"text":"铁锹","color":"green"}]
+scoreboard players add @s[tag=canbuy] shop_weapon 1
+scoreboard players remove @s[tag=canbuy] gold 81
+execute as @s[tag=!canbuy] at @s run function lib:sounds/error
+execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
+execute as @s[tag=canbuy] run function item:shop/refresh_gold
+tag @s remove canbuy

+ 16 - 0
data/old/item/functions/shop/buy_weapon4.mcfunction

@@ -0,0 +1,16 @@
+# 钻石锹 (3 gb)
+# 触发器ID 14
+execute unless entity @s[scores={shop_weapon=0..}] run scoreboard players set @s shop_weapon 0
+tag @s remove canbuy
+tag @s[scores={shop_weapon=3,gold=243..}] add canbuy
+tellraw @s[scores={shop_weapon=4..}] ["",{"text":">> ","color":"aqua","bold":true},{"text":"你已经购买了这个物品了!","color":"aqua"}]
+tellraw @s[scores={shop_weapon=3,gold=..242}] ["",{"text":">> ","color":"red","bold":true},{"text":"你没有足够的金块来购买这个物品!","color":"red"}]
+tellraw @s[scores={shop_weapon=..2}] ["",{"text":">> ","color":"red","bold":true},{"text":"你需要先购买上一级的物品!","color":"red"}]
+tellraw @s[tag=canbuy] ["",{"text":">> ","color":"green","bold":true},"你购买了 ",{"text":"钻石锹","color":"green"}]
+execute as @s[tag=canbuy] run tellraw @a[tag=!canbuy] ["",{"text":">> ","color":"green","bold":true},{"selector": "@s","color":"green"}," 购买了 ",{"text":"钻石锹","color":"green"}]
+scoreboard players add @s[tag=canbuy] shop_weapon 1
+scoreboard players remove @s[tag=canbuy] gold 243
+execute as @s[tag=!canbuy] at @s run function lib:sounds/error
+execute as @s[tag=canbuy] at @s run function lib:sounds/levelup
+execute as @s[tag=canbuy] run function item:shop/refresh_gold
+tag @s remove canbuy

+ 10 - 0
data/old/item/functions/shop/charity.mcfunction

@@ -0,0 +1,10 @@
+# 慈善家(在区域外999)
+# 触发器ID 999
+tellraw @s[scores={gold=..0}] ["",{"text":">> ","color":"red","bold":true},{"text":"看起来你已经身无分文,不要再远程购物啦!","color":"red"}]
+tellraw @s[scores={gold=1..}] ["",{"text":">> ","color":"green","bold":true},{"text":"一堆金粒凭空出现在了老板面前,老板一边喊着好东西好东西一边收下了金粒!","color":"green"}]
+execute as @s[scores={gold=1..}] at @s run function lib:sounds/levelup
+execute as @s[scores={gold=..0}] at @s run function lib:sounds/error
+scoreboard players set @s[scores={gold=1..8}] gold 0
+scoreboard players remove @s[scores={gold=9..}] gold 9
+execute as @s run function item:shop/refresh_gold
+scoreboard players set @s buy_trigger 0

+ 39 - 0
data/old/item/functions/shop/check.mcfunction

@@ -0,0 +1,39 @@
+execute if score @s buy_trigger matches 1..18 at @s unless entity @s[x=-3,z=-63,y=6,dx=25,dy=6,dz=30] run function item:shop/error
+execute if score @s buy_trigger matches 19..21 at @s unless entity @s[x=1,z=-63,y=20,dx=5,dy=4,dz=6] run function item:shop/error
+execute if score @s buy_trigger matches 100..108 at @s unless entity @s[x=-22,z=-75,y=18,dx=10,dy=4,dz=5] run function item:shop/error
+execute if score @s buy_trigger matches 999 at @s unless entity @s[x=-3,z=-49,y=27,dx=5,dy=4,dz=5] run function item:shop/charity
+
+execute if score @s buy_trigger matches 1 if score $state mem matches 0 run function item:shop/buy_apple1
+execute if score @s buy_trigger matches 2 if score $state mem matches 0 run function item:shop/buy_apple2
+execute if score @s buy_trigger matches 3 if score $state mem matches 0 run function item:shop/buy_armor1
+execute if score @s buy_trigger matches 5 if score $state mem matches 0 run function item:shop/buy_armor2
+execute if score @s buy_trigger matches 6 if score $state mem matches 0 run function item:shop/buy_armor3
+execute if score @s buy_trigger matches 7 if score $state mem matches 0 run function item:shop/buy_arrow1
+execute if score @s buy_trigger matches 8 if score $state mem matches 0 run function item:shop/buy_arrow2
+execute if score @s buy_trigger matches 9 if score $state mem matches 0 run function item:shop/buy_arrow3
+execute if score @s buy_trigger matches 10 if score $state mem matches 0 run function item:shop/buy_orange
+execute if score @s buy_trigger matches 11 if score $state mem matches 0 run function item:shop/buy_weapon1
+execute if score @s buy_trigger matches 12 if score $state mem matches 0 run function item:shop/buy_weapon2
+execute if score @s buy_trigger matches 13 if score $state mem matches 0 run function item:shop/buy_weapon3
+execute if score @s buy_trigger matches 14 if score $state mem matches 0 run function item:shop/buy_weapon4
+execute if score @s buy_trigger matches 15 if score $state mem matches 0 run function item:shop/buy_bow
+execute if score @s buy_trigger matches 16 if score $state mem matches 0 run function item:shop/buy_potion_resist
+execute if score @s buy_trigger matches 17 if score $state mem matches 0 run function item:shop/buy_potion_speed1
+execute if score @s buy_trigger matches 18 if score $state mem matches 0 run function item:shop/buy_potion_speed2
+execute if score @s buy_trigger matches 19 if score $state mem matches 0 run function item:shop/buy_firework
+execute if score @s buy_trigger matches 20 if score $state mem matches 0 run function item:shop/buy_bgm
+execute if score @s buy_trigger matches 21 if score $state mem matches 0 run function item:shop/buy_pig
+execute if score @s buy_trigger matches 100 if score $state mem matches 0 run function item:shop/buy_particle_system
+execute if score @s buy_trigger matches 101 if score $state mem matches 0 run function item:shop/buy_particle_close
+execute if score @s buy_trigger matches 102 if score $state mem matches 0 run function item:shop/buy_particle0
+execute if score @s buy_trigger matches 103 if score $state mem matches 0 run function item:shop/buy_particle1
+execute if score @s buy_trigger matches 104 if score $state mem matches 0 run function item:shop/buy_particle2
+execute if score @s buy_trigger matches 105 if score $state mem matches 0 run function item:shop/buy_particle3
+execute if score @s buy_trigger matches 106 if score $state mem matches 0 run function item:shop/buy_particle4
+execute if score @s buy_trigger matches 107 if score $state mem matches 0 run function item:shop/buy_particle5
+execute if score @s buy_trigger matches 108 if score $state mem matches 0 run function item:shop/buy_particle6
+execute if score @s buy_trigger matches 999 if score $state mem matches 0 run function item:shop/buy_dice
+execute if score @s buy_trigger matches 85304 if score $state mem matches 0 run function item:shop/puzzle
+execute if score @s buy_trigger matches 114514 if score $state mem matches 0 run function item:shop/buy_easter_egg
+scoreboard players set @s buy_trigger 0
+execute if score $state mem matches 0 run scoreboard players enable @s buy_trigger

+ 5 - 0
data/old/item/functions/shop/error.mcfunction

@@ -0,0 +1,5 @@
+# 不在购物区域
+# 触发器ID None
+scoreboard players set @s buy_trigger 0
+tellraw @s ["",{"text":">> ","color":"red","bold":true},{"text":"老板还没开通网上购物服务,请进入实体店购买!","color":"red"}]
+execute at @s run function lib:sounds/error

+ 24 - 0
data/old/item/functions/shop/puzzle.mcfunction

@@ -0,0 +1,24 @@
+
+# 为玩家添加 1~15 的随机数
+scoreboard players set $random_max mem 15
+scoreboard players set $random_min mem 1
+function lib:random
+scoreboard players operation @s[tag=!puzzle] puzzle = $random mem
+tag @s add puzzle
+
+# 根据随机数发送情报
+tellraw @s[scores={puzzle=01}] ["",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/11j_yn8l1e02bxDRozakKFw"},"text":"t5zy"}," ",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1-CftPq2vzYtab-YoVuXQYQ"},"text":"ives"}," ",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1n5AOK9EKOKym7TaprLGbKQ"},"text":"jwuj"}]
+tellraw @s[scores={puzzle=02}] ["",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1JIZW4NKXqE8_45QaNiGKaA"},"text":"jxyn"}," ",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1xQx2vkqZYepn0baMwQNL0g"},"text":"3qyr"}," ",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1E6oY2wJUgCVZEp-HgtG1kg"},"text":"36ae"}]
+tellraw @s[scores={puzzle=03}] ["",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1kA5_CLNsZ8yw8aSuhRlhww"},"text":"8iqe"}," ",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1ikASm9KedWUXgYzNjl758w"},"text":"y5gt"}," ",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1vJR2tE221Mz4PVyw71yiww"},"text":"ethd"}]
+tellraw @s[scores={puzzle=04}] ["",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1NvhQCD-tN-peuT_uHkTpxg"},"text":"vyr6"}," ",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1p1OvB3v0T5G1ptYCjOXf3w"},"text":"6xri"}," ",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/18dEMTi_8uIJF9RbpIYjraw"},"text":"5ikk"}]
+tellraw @s[scores={puzzle=05}] ["",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1d9a1IJUlOKzXwRPt-NAYtQ"},"text":"cj33"}," ",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1ffJl_ZaJQ0ZDvVKmdsGTyw"},"text":"5qcc"}," ",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1vSc1eoJ_LiKSSi_2TI-UNg"},"text":"p8u9"}]
+tellraw @s[scores={puzzle=06}] ["",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1SXPXLNqal7BgAAAxvQ15gw"},"text":"vh9c"}," ",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1nPmYBaMW6_TdevWW3i55PQ"},"text":"4jwd"}," ",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/11M0QW1Az4zEiZneGXtO3AA"},"text":"nanb"}]
+tellraw @s[scores={puzzle=07}] ["",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/15KSiwg8eMK4pBqkbo2q_QQ"},"text":"9pe8"}," ",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1aNekoeWoEuy5xmuXzwGn8w"},"text":"r589"}," ",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1Mkpypmejb3AZXkDd8y52ag"},"text":"p9fd"}]
+tellraw @s[scores={puzzle=08}] ["",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1RErlW0dzIpTIUhPjWhEb7w"},"text":"jh5h"}," ",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/10y2xahprPJjfaPzejitBuw"},"text":"6kb5"}," ",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1Qd_F5AHNXIo0yyawpceyXw"},"text":"wi3r"}]
+tellraw @s[scores={puzzle=09}] ["",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1bk5DjPgyinuDhnMiAt6sVQ"},"text":"hv63"}," ",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1QDIpZDsLB5_tW2sBzLjmsA"},"text":"5su5"}," ",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1Qh5-pmJx6bkx4QdYVF6YQA"},"text":"qc3y"}]
+tellraw @s[scores={puzzle=10}] ["",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1RmBcLXyv5ULDZRqPzXo3og"},"text":"ksav"}," ",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1hYoecEj-g5u6wvX1L3UsIA"},"text":"zvmt"}," ",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1g-GGlYy1Sufm6LUxnF2X4w"},"text":"5d29"}]
+tellraw @s[scores={puzzle=11}] ["",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1wEvhLCyaBqnj1OZhHuQy-Q"},"text":"1gtw"}," ",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1sJK_xSTU4gYYqe9r7KaZpg"},"text":"xxgs"}," ",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/147Cw36IKAYfYYnWMMlEf-A"},"text":"r5m4"}]
+tellraw @s[scores={puzzle=12}] ["",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1DKmsrcMIvmL6JffBWjHe6g"},"text":"vizx"}," ",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1rYJ6PKzm1wahoJcy4MjAoA"},"text":"5vt8"}," ",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1XAbdwintJmt1A1CMWfBiGQ"},"text":"g29x"}]
+tellraw @s[scores={puzzle=13}] ["",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1brLgH7vf78-BtGsXjyy7cA"},"text":"w5zq"}," ",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1iQGaz-ECt0N7Q03Ga5RNuw"},"text":"fehz"}," ",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/15DGVU3iKf9i9mr7LT73ykA"},"text":"n17a"}]
+tellraw @s[scores={puzzle=14}] ["",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1RxDBpYDUEoqZ9_s7RlFpSA"},"text":"cygk"}," ",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1qLUIw_0TtDCQyd6fn-As3w"},"text":"agvi"}," ",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1iXI66MPwgCKQ0leFJRQWtQ"},"text":"4yrs"}]
+tellraw @s[scores={puzzle=15}] ["",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1dw-Ue6ZuLN3RZr8w-HLkaw"},"text":"tck1"}," ",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1z7LE8ongD8fbBxrrzV2yvQ"},"text":"jg9f"}," ",{"color":"blue","underlined": true,"clickEvent": {"action":"open_url","value":"https://pan.baidu.com/s/1Uh5MrM8j3N0sa_wSmMWOGQ"},"text":"wdqt"}]

+ 36 - 0
data/old/item/functions/shop/refresh_equip.mcfunction

@@ -0,0 +1,36 @@
+# 刷新单个玩家购买的物品
+
+clear @s bow
+give @s[scores={shop_bow=1}] bow{display:{Name:'{"text":"弓","italic":false,"color":"gray"}'},Damage:381}
+
+clear @s wooden_shovel
+clear @s stone_shovel
+give @s[scores={shop_weapon=1}] wooden_shovel{display:{Name:'{"text":"木锹","italic":false,"color":"gray"}'}}
+give @s[scores={shop_weapon=2..}] stone_shovel{display:{Name:'{"text":"石锹","italic":false,"color":"gray"}'}}
+
+clear @s splash_potion
+give @s[scores={shop_potion_spd=1}] splash_potion{CustomPotionEffects:[{Id:1,Amplifier:0,Duration:300}],CustomPotionColor:8039610,display:{Name:'{"text":"喷溅型迅捷药水","italic":false,"color":"gray"}'}}
+give @s[scores={shop_potion_spd=2}] splash_potion{CustomPotionEffects:[{Id:1,Amplifier:1,Duration:300}],CustomPotionColor:8039610,display:{Name:'{"text":"喷溅型迅捷药水","italic":false,"color":"gray"}'}}
+give @s[scores={shop_potion_rst=1}] splash_potion{CustomPotionEffects:[{Id:11,Amplifier:0,Duration:400}],CustomPotionColor:9913400,display:{Name:'{"text":"喷溅型抵抗药水","italic":false,"color":"gray"}'}}
+
+clear @s golden_apple
+clear @s enchanted_golden_apple
+give @s[scores={shop_apple=1}] golden_apple{display:{Lore:['{"text":"恢复 4 颗心或生命 +1","italic":false,"color":"gray"}'],Name:'{"text":"生命果","italic":false,"color":"green"}'}}
+give @s[scores={shop_apple=2}] enchanted_golden_apple{display:{Name:'{"text":"附魔生命果","italic":false}',Lore:['{"text":"恢复到满血或生命加倍","italic":false,"color":"gray"}']}}
+scoreboard players reset @s shop_apple
+
+clear @s arrow
+clear @s tipped_arrow
+give @s[scores={shop_arrow=1}] arrow
+give @s[scores={shop_arrow=2}] arrow 2
+give @s[scores={shop_arrow=3}] tipped_arrow{Potion:"minecraft:slowness"} 2
+
+clear @s crossbow
+give @s[scores={shop_firework=1}] minecraft:crossbow{display:{Name:'{"text":"烟花弩","italic":false,"color":"gray"}',Lore:['{"text":"发射一个漂亮的烟花!","italic":false,"color":"gray"}']},Damage:326,Charged:1b,ChargedProjectiles:[{id:"firework_rocket",Count:1b,tag:{Fireworks:{Flight:1b,Explosions:[{Type:0b,Colors:[I;11743532,15435844,14602026,4312372,6719955,2437522,8073150]}]}}}]} 1
+
+replaceitem entity @s armor.chest air
+replaceitem entity @s[scores={shop_armor=3..}] armor.chest golden_chestplate{display:{Name:'{"text":"金胸甲","italic":false,"color":"gray"}'}}
+replaceitem entity @s armor.legs air
+replaceitem entity @s[scores={shop_armor=2}] armor.legs golden_leggings{display:{Name:'{"text":"金护腿","italic":false,"color":"gray"}'}}
+replaceitem entity @s armor.feet air
+replaceitem entity @s[scores={shop_armor=1}] armor.feet golden_boots{display:{Name:'{"text":"金靴子","italic":false,"color":"gray"}'}}

+ 24 - 0
data/old/item/functions/shop/refresh_gold.mcfunction

@@ -0,0 +1,24 @@
+# 刷新单个玩家背包中的金粒
+
+execute unless entity @s[scores={gold=0..}] run scoreboard players set @s gold 0
+execute unless entity @s[scores={gold=0..}] run scoreboard players set @s gold_total 0
+clear @s gold_block
+clear @s gold_ingot
+clear @s gold_nugget
+
+# 获取金块数,存于 temp
+scoreboard players operation @s temp = @s gold
+scoreboard players operation @s temp /= #const_81 mem
+# 给予金块
+execute if score @s temp matches 1.. at @s run function item:shop/summon_gold_block
+# 获取金锭数,存于 temp
+scoreboard players operation @s temp = @s gold
+scoreboard players operation @s temp %= #const_81 mem
+scoreboard players operation @s temp /= #const_9 mem
+# 给予金锭
+execute if score @s temp matches 1.. at @s run function item:shop/summon_gold
+# 获取金粒数,存于 temp
+scoreboard players operation @s temp = @s gold
+scoreboard players operation @s temp %= #const_9 mem
+# 给予金粒
+execute if score @s temp matches 1.. at @s run function item:shop/summon_nugget

+ 17 - 0
data/old/item/functions/shop/refresh_green.mcfunction

@@ -0,0 +1,17 @@
+# 刷新单个玩家背包中的绿宝石
+
+execute unless entity @s[scores={green=0..}] run scoreboard players set @s green 0
+execute unless entity @s[scores={green=0..}] run scoreboard players set @s green_total 0
+clear @s emerald_block
+clear @s emerald
+
+# 获取绿宝石块数,存于 temp
+scoreboard players operation @s temp = @s green
+scoreboard players operation @s temp /= #const_9 mem
+# 给予绿宝石块
+execute if score @s temp matches 1.. at @s run function item:shop/summon_emerald_block
+# 获取绿宝石数,存于 temp
+scoreboard players operation @s temp = @s green
+scoreboard players operation @s temp %= #const_9 mem
+# 给予绿宝石
+execute if score @s temp matches 1.. at @s run function item:shop/summon_emerald

+ 1 - 0
data/old/item/functions/shop/special_bgm.mcfunction

@@ -0,0 +1 @@
+execute as @a run function lib:sounds/music/mini_fast

+ 1 - 0
data/old/item/functions/shop/special_easter_egg.mcfunction

@@ -0,0 +1 @@
+execute at @s run playsound entity.enderman.scream ambient @a 0 1000000 0 1000000

+ 1 - 0
data/old/item/functions/shop/special_pig.mcfunction

@@ -0,0 +1 @@
+execute at @s run playsound entity.pig.ambient ambient @a 0 1000000 0 1000000

+ 11 - 0
data/old/item/functions/shop/summon_emerald.mcfunction

@@ -0,0 +1,11 @@
+# 给予绿宝石
+summon item ~ ~ ~ {Item:{id:"emerald",Count:1b,tag:{stats_item:1b}},Tags:["score_item","new_stats"],PickupDelay:0}
+execute if score @s temp matches 1..64 store result entity @e[type=item,tag=score_item,limit=1] Item.Count byte 1 run scoreboard players get @s temp
+execute if score @s temp matches 65.. run data modify entity @e[type=item,tag=score_item,limit=1] Item.Count set value 64b 
+data modify entity @e[type=item,tag=score_item,limit=1] Owner set from entity @s UUID
+data modify entity @e[type=item,tag=score_item,limit=1] Thrower set from entity @s UUID
+tag @e[type=item,tag=score_item] remove score_item
+scoreboard players remove @s temp 64
+execute if score @s temp matches 1.. run function item:shop/summon_emerald
+
+

+ 11 - 0
data/old/item/functions/shop/summon_emerald_block.mcfunction

@@ -0,0 +1,11 @@
+# 给予绿宝石块
+summon item ~ ~ ~ {Item:{id:"emerald_block",Count:1b,tag:{stats_item:1b}},Tags:["score_item","new_stats"],PickupDelay:0}
+execute if score @s temp matches 1..64 store result entity @e[type=item,tag=score_item,limit=1] Item.Count byte 1 run scoreboard players get @s temp
+execute if score @s temp matches 65.. run data modify entity @e[type=item,tag=score_item,limit=1] Item.Count set value 64b 
+data modify entity @e[type=item,tag=score_item,limit=1] Owner set from entity @s UUID
+data modify entity @e[type=item,tag=score_item,limit=1] Thrower set from entity @s UUID
+tag @e[type=item,tag=score_item] remove score_item
+scoreboard players remove @s temp 64
+execute if score @s temp matches 1.. run function item:shop/summon_emerald_block
+
+

+ 11 - 0
data/old/item/functions/shop/summon_gold.mcfunction

@@ -0,0 +1,11 @@
+# 给予金锭
+summon item ~ ~ ~ {Item:{id:"gold_ingot",Count:1b,tag:{stats_item:1b}},Tags:["score_item","new_stats"],PickupDelay:0}
+execute if score @s temp matches 1..64 store result entity @e[type=item,tag=score_item,limit=1] Item.Count byte 1 run scoreboard players get @s temp
+execute if score @s temp matches 65.. run data modify entity @e[type=item,tag=score_item,limit=1] Item.Count set value 64b 
+data modify entity @e[type=item,tag=score_item,limit=1] Owner set from entity @s UUID
+data modify entity @e[type=item,tag=score_item,limit=1] Thrower set from entity @s UUID
+tag @e[type=item,tag=score_item] remove score_item
+scoreboard players remove @s temp 64
+execute if score @s temp matches 1.. run function item:shop/summon_gold
+
+

+ 11 - 0
data/old/item/functions/shop/summon_gold_block.mcfunction

@@ -0,0 +1,11 @@
+# 给予金块
+summon item ~ ~ ~ {Item:{id:"gold_block",Count:1b,tag:{stats_item:1b}},Tags:["score_item","new_stats"],PickupDelay:0}
+execute if score @s temp matches 1..64 store result entity @e[type=item,tag=score_item,limit=1] Item.Count byte 1 run scoreboard players get @s temp
+execute if score @s temp matches 65.. run data modify entity @e[type=item,tag=score_item,limit=1] Item.Count set value 64b 
+data modify entity @e[type=item,tag=score_item,limit=1] Owner set from entity @s UUID
+data modify entity @e[type=item,tag=score_item,limit=1] Thrower set from entity @s UUID
+tag @e[type=item,tag=score_item] remove score_item
+scoreboard players remove @s temp 64
+execute if score @s temp matches 1.. run function item:shop/summon_gold_block
+
+

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů