#####SAVE-ABLE ITEMS RANDOM CHANCE
#reagants are special exception...
#execute as @s[nbt={Item:{id:"minecraft:emerald_block"}}] run scoreboard players set @s KyuDummy 10000
#execute as @s[nbt={Item:{id:"minecraft:diamond_block"}}] run scoreboard players set @s KyuDummy 10000

## based on the save-able item's KyuDummy score, round to the nearest 5th percent and apply that chance to save the item and run the next function
execute as @s[scores={KyuDummy=2250..2749}] run execute if predicate suhc:25percent run tag @s add ItemSave
execute as @s[scores={KyuDummy=2750..3249}] run execute if predicate suhc:30percent run tag @s add ItemSave
execute as @s[scores={KyuDummy=3250..3749}] run execute if predicate suhc:35percent run tag @s add ItemSave
execute as @s[scores={KyuDummy=3750..4249}] run execute if predicate suhc:40percent run tag @s add ItemSave
execute as @s[scores={KyuDummy=4250..4749}] run execute if predicate suhc:45percent run tag @s add ItemSave
execute as @s[scores={KyuDummy=4750..5249}] run execute if predicate suhc:50percent run tag @s add ItemSave
execute as @s[scores={KyuDummy=5250..5749}] run execute if predicate suhc:55percent run tag @s add ItemSave
execute as @s[scores={KyuDummy=5750..6249}] run execute if predicate suhc:60percent run tag @s add ItemSave
execute as @s[scores={KyuDummy=6250..6749}] run execute if predicate suhc:65percent run tag @s add ItemSave
execute as @s[scores={KyuDummy=6750..7249}] run execute if predicate suhc:70percent run tag @s add ItemSave
execute as @s[scores={KyuDummy=7250..7749}] run execute if predicate suhc:75percent run tag @s add ItemSave
execute as @s[scores={KyuDummy=7750..8249}] run execute if predicate suhc:80percent run tag @s add ItemSave
execute as @s[scores={KyuDummy=8250..8749}] run execute if predicate suhc:85percent run tag @s add ItemSave
execute as @s[scores={KyuDummy=8750..9249}] run execute if predicate suhc:90percent run tag @s add ItemSave
execute as @s[scores={KyuDummy=9250..9749}] run execute if predicate suhc:95percent run tag @s add ItemSave
execute as @s[scores={KyuDummy=9750..}] run tag @s add ItemSave
#execute as @s[tag=ItemSave,tag=!KyuReagant] run tellraw @a ["",{"color":"gold","score":{"name":"@s","objective":"KyuDummy"}},{"text":" score, is ","color":"yellow"},{"text":"ALIVE","color":"green"}]
#execute as @s[tag=!ItemSave,tag=!KyuReagant] run tellraw @a ["",{"color":"gold","score":{"name":"@s","objective":"KyuDummy"}},{"text":" score, is ","color":"yellow"},{"text":"DEAD","color":"red"}]

execute as @s[scores={KyuDummy=2250..}] run kill @s[tag=!ItemSave]