execute as @p unless items entity @s container.* *[custom_data~{cpu:true}] run tellraw @s {text:"Error! You need a CPU to make a Samsung Phone!",color:red}
execute as @p unless items entity @s container.* *[custom_data~{ram:true}] run tellraw @s {text:"Error! You need a RAM to make a Samsung Phone!",color:red}
execute as @p unless items entity @s container.* *[custom_data~{screen:true},count={min:3}] run tellraw @s {text:"Error! You need 3 Screens to make a Samsung Tablet!",color:red}
execute as @p if items entity @s container.* *[custom_data~{cpu:true}] if items entity @s container.* *[custom_data~{ram:true}] if items entity @s container.* *[custom_data~{screen:true},count={min:3}] run tellraw @s {text:"You made a Samsung Tablet!",color:green}
execute as @p if items entity @s container.* *[custom_data~{cpu:true}] if items entity @s container.* *[custom_data~{ram:true}] if items entity @s container.* *[custom_data~{screen:true},count={min:3}] run advancement grant @s only samsung:make_phone
execute as @p if items entity @s container.* *[custom_data~{cpu:true}] if items entity @s container.* *[custom_data~{ram:true}] if items entity @s container.* *[custom_data~{screen:true},count={min:3}] run playsound minecraft:block.smithing_table.use ui @s ~ ~ ~
execute as @p if items entity @s container.* *[custom_data~{cpu:true}] if items entity @s container.* *[custom_data~{ram:true}] if items entity @s container.* *[custom_data~{screen:true},count={min:3}] run give @s leather[custom_name={text:"Samsung Tablet",color:green,bold:true,italic:false},item_model="gold_ingot",custom_data={samsung_tablet:true},max_stack_size=16]
execute as @p if items entity @s container.* *[custom_data~{cpu:true}] if items entity @s container.* *[custom_data~{ram:true}] if items entity @s container.* *[custom_data~{screen:true},count={min:3}] run function samsung:clean_samsung_phone_components