execute if data entity @s item.components."minecraft:custom_data".common_material run function ws:work/misc/tier2/scientist/data1 with entity @s item.components."minecraft:custom_data"
execute if data entity @s item.components."minecraft:custom_data".uncommon_material run function ws:work/misc/tier2/scientist/data2 with entity @s item.components."minecraft:custom_data"
execute if data entity @s item.components."minecraft:custom_data".rare_material run function ws:work/misc/tier2/scientist/data3 with entity @s item.components."minecraft:custom_data"