function ws:work/misc/tier2/scientist/addcommon with entity @s item.components."minecraft:custom_data"
execute if score @s meteorite.common matches 1.. if data entity @s item.components."minecraft:custom_data"{common_material:'basalt'} run scoreboard players add @a[team=scientist] scientist.capital 1
execute if score @s meteorite.common matches 1.. if data entity @s item.components."minecraft:custom_data"{common_material:'blackstone'} run scoreboard players add @a[team=scientist] scientist.capital 1
execute if score @s meteorite.common matches 1.. if data entity @s item.components."minecraft:custom_data"{common_material:'iron'} run scoreboard players add @a[team=scientist] scientist.capital 2
execute if score @s meteorite.common matches 1.. if data entity @s item.components."minecraft:custom_data"{common_material:'gold'} run scoreboard players add @a[team=scientist] scientist.capital 4
scoreboard players remove @s meteorite.common 1
execute if score @s meteorite.common matches 0 as @e[tag=data1,type=text_display] run function ws:work/misc/tier2/scientist/mergetext with entity @s
execute if score @s meteorite.common matches 0.. run return 0
execute unless score @s meteorite.study.health matches ..250 run return 0
function ws:work/misc/tier2/scientist/adduncommon with entity @s item.components."minecraft:custom_data"
execute if score @s meteorite.uncommon matches 1.. if data entity @s item.components."minecraft:custom_data"{uncommon_material:'iron'} run scoreboard players add @a[team=scientist] scientist.capital 1
execute if score @s meteorite.uncommon matches 1.. if data entity @s item.components."minecraft:custom_data"{uncommon_material:'gold'} run scoreboard players add @a[team=scientist] scientist.capital 3
scoreboard players remove @s meteorite.uncommon 1
execute if score @s meteorite.uncommon matches 0 as @e[tag=data2,type=text_display] run function ws:work/misc/tier2/scientist/mergetext with entity @s
execute if score @s meteorite.uncommon matches 0.. run return 0
execute unless score @s meteorite.study.health matches ..100 run return 0
function ws:work/misc/tier2/scientist/addrare with entity @s item.components."minecraft:custom_data"
execute if score @s meteorite.rare matches 1.. if data entity @s item.components."minecraft:custom_data"{rare_material:'emerald'} run scoreboard players add @a[team=scientist] scientist.capital 4
execute if score @s meteorite.rare matches 1.. if data entity @s item.components."minecraft:custom_data"{rare_material:'diamond'} run scoreboard players add @a[team=scientist] scientist.capital 8
scoreboard players remove @s meteorite.rare 1
execute if score @s meteorite.rare matches 0 as @e[tag=data3,type=text_display] run function ws:work/misc/tier2/scientist/mergetext with entity @s