villager_level_up.mcfunction 821 B

1234567
  1. execute store result score @s temp2 run data get entity @s Xp
  2. execute if entity @s[nbt={VillagerData:{level:4}}] if score @s temp2 matches 250.. run tag @s add upgradeVillager
  3. execute if entity @s[nbt={VillagerData:{level:4}}] if score @s temp2 matches 250.. run data modify entity @s VillagerData.level set value 5
  4. execute if entity @s[nbt={VillagerData:{level:3}}] if score @s temp2 matches 150.. run tag @s add upgradeVillager
  5. execute if entity @s[nbt={VillagerData:{level:3}}] if score @s temp2 matches 150.. run data modify entity @s VillagerData.level set value 4
  6. execute if entity @s[nbt={VillagerData:{level:2}}] if score @s temp2 matches 70.. run tag @s add upgradeVillager
  7. execute if entity @s[nbt={VillagerData:{level:2}}] if score @s temp2 matches 70.. run data modify entity @s VillagerData.level set value 3