data modify entity @s data.prize.amount set value 0
execute store result entity @s data.prize.copper int 1 at @s if items entity @e[tag=slots,limit=3,sort=nearest] container.0 *[minecraft:custom_data~{material:'copper'}]
execute store result entity @s data.prize.iron int 1 at @s if items entity @e[tag=slots,limit=3,sort=nearest] container.0 *[minecraft:custom_data~{material:'iron'}]
execute store result entity @s data.prize.gold int 1 at @s if items entity @e[tag=slots,limit=3,sort=nearest] container.0 *[minecraft:custom_data~{material:'gold'}]
execute store result entity @s data.prize.netherite int 1 at @s if items entity @e[tag=slots,limit=3,sort=nearest] container.0 *[minecraft:custom_data~{material:'netherite'}]
execute store result entity @s data.prize.prismarine int 1 at @s if items entity @e[tag=slots,limit=3,sort=nearest] container.0 *[minecraft:custom_data~{material:'prismarine'}]
execute store result entity @s data.prize.amethyst int 1 at @s if items entity @e[tag=slots,limit=3,sort=nearest] container.0 *[minecraft:custom_data~{material:'amethyst'}]
execute store result entity @s data.prize.emerald int 1 at @s if items entity @e[tag=slots,limit=3,sort=nearest] container.0 *[minecraft:custom_data~{material:'emerald'}]
execute store result entity @s data.prize.diamond int 1 at @s if items entity @e[tag=slots,limit=3,sort=nearest] container.0 *[minecraft:custom_data~{material:'diamond'}]
execute store result entity @s data.prize.nugget int 1 at @s if items entity @e[tag=slots,limit=3,sort=nearest] container.0 *[minecraft:custom_data~{type:'nugget'}]
execute store result entity @s data.prize.ingot int 1 at @s if items entity @e[tag=slots,limit=3,sort=nearest] container.0 *[minecraft:custom_data~{type:'ingot'}]
execute store result entity @s data.prize.block int 1 at @s if items entity @e[tag=slots,limit=3,sort=nearest] container.0 *[minecraft:custom_data~{type:'block'}]
execute store result entity @s data.prize.gem int 1 at @s if items entity @e[tag=slots,limit=3,sort=nearest] container.0 *[minecraft:custom_data~{type:'gem'}]
execute if data entity @s {data:{prize:{copper:3}}} run data modify entity @s data.prize.amount set value 10
execute if data entity @s {data:{prize:{iron:3}}} run data modify entity @s data.prize.amount set value 30
execute if data entity @s {data:{prize:{gold:3}}} run data modify entity @s data.prize.amount set value 60
execute if data entity @s {data:{prize:{netherite:3}}} run data modify entity @s data.prize.amount set value 100
execute if data entity @s {data:{prize:{amethyst:3}}} run data modify entity @s data.prize.amount set value 45
execute if data entity @s {data:{prize:{prismarine:3}}} run data modify entity @s data.prize.amount set value 6
execute if data entity @s {data:{prize:{emerald:3}}} run data modify entity @s data.prize.amount set value 250
execute if data entity @s {data:{prize:{diamond:3}}} run data modify entity @s data.prize.amount set value 500
execute if data entity @s {data:{prize:{nugget:3,amount:0}}} run data modify entity @s data.prize.amount set value 8
execute if data entity @s {data:{prize:{ingot:3,amount:0}}} run data modify entity @s data.prize.amount set value 20
execute if data entity @s {data:{prize:{block:3,amount:0}}} run data modify entity @s data.prize.amount set value 15
execute if data entity @s {data:{prize:{gem:3,amount:0}}} run data modify entity @s data.prize.amount set value 10
execute if data entity @s {data:{prize:{amount:0}}} unless data entity @s {data:{prize:{iron:2}}} unless data entity @s {data:{prize:{copper:2}}} unless data entity @s {data:{prize:{gold:2}}} unless data entity @s {data:{prize:{netherite:2}}} unless data entity @s {data:{prize:{amethyst:2}}} unless data entity @s {data:{prize:{emerald:2}}} unless data entity @s {data:{prize:{diamond:2}}} unless data entity @s {data:{prize:{prismarine:2}}} run data modify entity @s data.prize.amount set value 5
execute if data entity @s {data:{prize:{amount:0}}} run data modify entity @s data.prize.amount set value 10
execute if data entity @s {data:{prize:{nugget:1,ingot:1,block:1}}} if data entity @s {data:{prize:{amethyst:0}}} if data entity @s {data:{prize:{emerald:0}}} if data entity @s {data:{prize:{diamond:0}}} if data entity @s {data:{prize:{prismarine:0}}} run return run data get entity @s data.prize.amount 3
execute if data entity @s {data:{prize:{nugget:3}}} run return run data get entity @s data.prize.amount 2.5
execute if data entity @s {data:{prize:{ingot:3}}} run return run data get entity @s data.prize.amount 3
execute if data entity @s {data:{prize:{gem:3}}} run return run data get entity @s data.prize.amount 4.5
execute if data entity @s {data:{prize:{block:3}}} run return run data get entity @s data.prize.amount 6
return run data get entity @s data.prize.amount