bonus_item.mcfunction 718 B

123456789101112
  1. # 检查玩家拾取的奖励物品并进行处理
  2. setblock 8 12 2009 jukebox
  3. data modify block 8 12 2009 RecordItem set from entity @s Inventory[{"tag":{"bonus_new":1b}}]
  4. tellraw @a ["",{"text": ">> ","color":"aqua","bold": true},{"selector": "@s","color":"yellow"},{"text":"获得了 "},{"nbt": "RecordItem.tag.bonus_name","block": "8 12 2009","interpret": true}]
  5. data modify block 8 12 2009 RecordItem.tag.bonus_new set value 0b
  6. clear @s #item:items{"bonus_new":1b}
  7. fill 8 12 2009 8 12 2009 air destroy
  8. tag @s add bonus_op
  9. execute as @e[tag=!bonus_old,type=minecraft:item,nbt={"Item":{"tag":{"bonus":1b}}},limit=1] run function item:bonus_item_give
  10. tag @s remove bonus_op
  11. # TODO : [010] 将坐标迁移到主大厅