announce_upgrade.mcfunction 1.7 KB

12345678910111213
  1. tag @s add self
  2. execute if entity @e[type=villager,limit=1,tag=upgradeVillager,nbt={VillagerData:{level:3}}] run tellraw @a[tag=!self] ["",{"text":">> ","color":"gold","bold":true},{"selector":"@s","color":"gold"}," 的村民到达了 ",{"text":"老手级","color":"gold"}]
  3. execute if entity @e[type=villager,limit=1,tag=upgradeVillager,nbt={VillagerData:{level:4}}] run tellraw @a[tag=!self] ["",{"text":">> ","color":"gold","bold":true},{"selector":"@s","color":"gold"}," 的村民到达了 ",{"text":"专家级","color":"gold"}]
  4. execute if entity @e[type=villager,limit=1,tag=upgradeVillager,nbt={VillagerData:{level:5}}] run tellraw @a[tag=!self] ["",{"text":">> ","color":"gold","bold":true},{"selector":"@s","color":"gold"}," 的村民到达了 ",{"text":"大师级","color":"gold"}]
  5. execute as @a[tag=!self] at @s run function lib:sounds/error
  6. execute if entity @e[type=villager,limit=1,tag=upgradeVillager,nbt={VillagerData:{level:3}}] run tellraw @s ["",{"text":">> ","color":"green","bold":true},"你的村民到达了 ",{"text":"老手级, 重新开启交易页面以查看新的交易!","color":"green"}]
  7. execute if entity @e[type=villager,limit=1,tag=upgradeVillager,nbt={VillagerData:{level:4}}] run tellraw @s ["",{"text":">> ","color":"green","bold":true},"你的村民到达了 ",{"text":"专家级, 重新开启交易页面以查看新的交易!","color":"green"}]
  8. execute if entity @e[type=villager,limit=1,tag=upgradeVillager,nbt={VillagerData:{level:5}}] run tellraw @s ["",{"text":">> ","color":"green","bold":true},"你的村民到达了 ",{"text":"大师级, 重新开启交易页面以查看新的交易!","color":"green"}]
  9. execute at @s run function lib:sounds/levelup
  10. tag @s remove self