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}] run tellraw @s {text:"Error! You need a Screen to make a Samsung Phone!",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}] run tellraw @s {text:"You made a Samsung Phone!",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}] 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}] 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}] run give @s leather[custom_name={text:"Samsung Phone",color:green,bold:true,italic:false},item_model="iron_ingot",custom_data={samsung_phone:true}]
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}] run function samsung:clean_samsung_phone_components