Explorar el Código

Merge branch 'master' of https://github.com/LTCatt/LTW3

LTCatt hace 6 años
padre
commit
77d607b6da
Se han modificado 1 ficheros con 6 adiciones y 2 borrados
  1. 6 2
      data/ltw/functions/shop/refresh_gold.mcfunction

+ 6 - 2
data/ltw/functions/shop/refresh_gold.mcfunction

@@ -7,10 +7,14 @@ clear @s gold_nugget
 scoreboard players operation @s temp = @s gold
 scoreboard players operation @s temp = @s gold
 scoreboard players operation @s temp /= #count_9 mem
 scoreboard players operation @s temp /= #count_9 mem
 # 给予金锭
 # 给予金锭
-
+execute if score @s temp matches 1.. run summon item ~ ~ ~ {Item:{id:"gold_ingot",Count:1b},Tags:["score_item_ingot"],PickupDelay:0}
+execute if score @s temp matches 1.. store result entity @e[type=item,tag=score_item_ingot,limit=1] Item.Count byte 1 run scoreboard players get @s temp
+execute if score @s temp matches 1.. run data modify entity @e[type=item,tag=score_item_ingot,limit=1] Owner set from entity @s UUID
 # 获取金粒数,存于 temp
 # 获取金粒数,存于 temp
 scoreboard players operation @s temp = @s gold
 scoreboard players operation @s temp = @s gold
 scoreboard players operation @s temp %= #count_9 mem
 scoreboard players operation @s temp %= #count_9 mem
 # 给予金粒
 # 给予金粒
-
+execute if score @s temp matches 1.. run summon item ~ ~ ~ {Item:{id:"gold_nugget",Count:1b},Tags:["score_item_nugget"],PickupDelay:0}
+execute if score @s temp matches 1.. store result entity @e[type=item,tag=score_item_nugget,limit=1] Item.Count byte 1 run scoreboard players get @s temp
+execute if score @s temp matches 1.. run data modify entity @e[type=item,tag=score_item_nugget,limit=1] Owner set from entity @s UUID
 # TODO : 给予指定数量的物品
 # TODO : 给予指定数量的物品