00ll00 5 years ago
parent
commit
105179430c

+ 1 - 1
data/item/functions/bonus_item/add_score.mcfunction

@@ -1,5 +1,5 @@
 #as player
-execute store result score #bonus_add_score mem run data get storage item:bouns item.tag.bonus_add_score
+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

+ 1 - 1
data/item/functions/bonus_item/bonus_item_tag.json

@@ -10,7 +10,7 @@
         {"id":"minecraft:stone","Count":64,"tag":{"is_bonus":true,"display":{"Name":"\"普通的石头\""}}},
         {"id":"minecraft:arrow","Count":64,"tag":{"is_bonus":true}}
     ],
-    "bonus_random_bounds":[
+    "bonus_random_bonus":[
         {"type":"normal","level":"white","count":2},
         {"type":"score","level":"green","count":1}
     ]

+ 3 - 3
data/item/functions/bonus_item/call.mcfunction

@@ -2,8 +2,8 @@
 # as player
 
 # 获取玩家待处理奖励物品列表
-data modify storage item:bouns item_buff set value []
-data modify storage item:bouns item_buff append from entity @s Inventory[{"tag":{"bonus_new":1b}}]
+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:bouns item_buff[0] run function item:bonus_item/call_each
+execute if data storage item:bonus item_buff[0] run function item:bonus_item/call_each

+ 8 - 8
data/item/functions/bonus_item/call_each.mcfunction

@@ -2,26 +2,26 @@
 # as player
 
 # 获取当前物品
-data modify storage item:bouns item set from storage item:bouns item_buff[0]
-data remove storage item:bouns item_buff[0]
+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:bouns item.tag.bonus_add_score unless data storage item:bouns item.tag.bonus_random_bounds[0] run tellraw @a ["",{"text": ">> ","color":"aqua","bold": true},{"selector": "@s","color":"aqua"}," 获得了 ",{"nbt": "item.tag.item_name","storage":"item:bouns","interpret": true}]
+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:bouns item.tag{"bonus_return":1b} run function item:bonus_item/return_item
+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:bouns item.tag.bonus_add_score run function item:bonus_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:bouns item.tag.bonus_give_items[0] run function item:bonus_item/give_items
+execute if data storage item:bonus item.tag.bonus_give_items[0] run function item:bonus_item/give_items
 
-# 如果有 random_bounds 标签则返还随机物品
-execute if data storage item:bouns item.tag.bonus_random_bounds[0] run function item:bonus_item/random_bounds
+# 如果有 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

+ 3 - 3
data/item/functions/bonus_item/give_items.mcfunction

@@ -1,9 +1,9 @@
 #as player
 setblock 0 0 0 jukebox replace
-data modify block 0 0 0 RecordItem set from storage item:bouns item.tag.bonus_give_items[0]
+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:bouns item.tag.bonus_give_items[0]
-execute if data storage item:bouns item.tag.bonus_give_items[0] run function item:bonus_item/give_items
+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

+ 8 - 0
data/item/functions/bonus_item/random_bonus.mcfunction

@@ -0,0 +1,8 @@
+#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":"normal"} run function item:bonus_item/random_normal
+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/random_bonus

+ 0 - 8
data/item/functions/bonus_item/random_bounds.mcfunction

@@ -1,8 +0,0 @@
-#as player
-setblock 0 0 1 shulker_box replace
-data modify storage item:bonus random_bounds set from storage item:bouns item.tag.bonus_random_bounds[0]
-data remove storage item:bouns item.tag.bonus_random_bounds[0]
-execute store result score $item.random.count mem run data get storage item:bonus random_bounds.count
-execute if score $item.random.count mem matches 1.. if data storage item:bonus random_bounds{"type":"normal"} run function item:bonus_item/random_normal
-execute if score $item.random.count mem matches 1.. if data storage item:bonus random_bounds{"type":"score"} run function item:bonus_item/random_score
-execute if data storage item:bouns item.tag.bonus_random_bounds[0] run function item:bonus/random_bounds

+ 5 - 5
data/item/functions/bonus_item/random_normal.mcfunction

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

+ 5 - 5
data/item/functions/bonus_item/random_score.mcfunction

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

+ 1 - 1
data/item/functions/bonus_item/return_item.mcfunction

@@ -1,5 +1,5 @@
 setblock 0 0 0 jukebox replace
-data modify block 0 0 0 RecordItem set from storage item:bouns item
+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