2
0
00ll00 6 жил өмнө
parent
commit
47e06ae87e

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

@@ -9,11 +9,11 @@ clear @s #item:bonus{"bonus_new":1b}
 # 通知玩家物品被拾取
 tellraw @a ["",{"text": ">> ","color":"aqua","bold": true},{"selector": "@s","color":"aqua"}," 获得了 ",{"nbt": "RecordItem.tag.item_name","block": "0 0 0","interpret": true}]
 
+# 如果有 return 标签则退回物品(最先执行)
+execute if data block 0 0 0 RecordItem.tag{"bonus_return":1b} run function item:bonus_item/return_item
+
 # 如果有 add_score 标签则增加积分
 execute if data block 0 0 0 RecordItem.tag.bonus_add_score run function item:bonus_item/add_score
 
 # 如果有 give_items 标签则给与物品
 execute if data block 0 0 0 RecordItem.tag.bonus_give_items[0] run function item:bonus_item/give_items
-
-# 如果有 return 标签则退回物品(最后执行)
-execute if data block 0 0 0 RecordItem.tag{"bonus_return":1b} run function item:bonus_item/return_item

+ 4 - 2
data/item/functions/bonus_item/return_item.mcfunction

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