execute if entity @s[advancements={nitref:dragonology/chest=true}] run tag @e[tag=nitDragonStor,limit=1,sort=nearest] add nitUnlocked
execute if entity @s[advancements={nitref:dragonology/head=true}] run tag @e[tag=nitDragonHead,limit=1,sort=nearest] add nitUnlocked
execute if entity @s[advancements={nitref:dragonology/egg=true}] run tag @e[tag=nitDragonEgg,limit=1,sort=nearest] add nitUnlocked
execute if entity @s[advancements={nitref:dragonology/trades=true}] run tag @e[tag=nitDragonologist,limit=1,sort=nearest] add nitUnlocked
execute if entity @s[advancements={nitref:dragonology/armor=true}] run tag @e[tag=nitDragonArmor,limit=1,sort=nearest] add nitUnlocked

data modify entity @e[tag=nitDragonologist,limit=1,sort=nearest] Xp set value 150
scoreboard players add @e[tag=nitDragonologist,limit=1,sort=nearest] nitDragonState 1
scoreboard players set @e[tag=nitDragonologist,limit=1,sort=nearest,scores={nitDragonState=5}] nitDragonState 0