paper_show.mcfunction 515 B

123456789
  1. # 清理物品
  2. clear @s paper{game_item:1b}
  3. # 返还物品
  4. execute if data entity @s Inventory[{Slot:8b}] run scoreboard players set @s item_slot 8
  5. execute if data entity @s Inventory[{Slot:8b}] at @s run function item:pop_slot/return_item
  6. # 设置最后一格的物品
  7. item replace entity @s hotbar.8 with paper{game_item:1b,display:{Name:'[{"text":"交易契约","color":"white","italic":false}]',Lore:['[{"text":"当你手持该契约时,村民将会出现在你的面前","italic":false,"color":"gray"}]']}}