summon_nugget.mcfunction 626 B

12345678910
  1. # 给予金粒
  2. summon item ~ ~ ~ {Item:{id:"gold_nugget",Count:1b},Tags:["score_item"],PickupDelay:0}
  3. 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
  4. execute if score @s temp matches 65.. run data modify entity @e[type=item,tag=score_item,limit=1] Item.Count set value 64b
  5. data modify entity @e[type=item,tag=score_item,limit=1] Owner set from entity @s UUID
  6. tag @e[type=item,tag=score_item] remove score_item
  7. scoreboard players remove @s temp 64
  8. execute if score @s temp matches 1.. run function item:shop/summon_nugget