tag @a remove KyuNotchy
tag @a remove KyuNotchy2


tag @a[tag=K,nbt={Inventory:[{id:"minecraft:apple"}]}] add QAP
give @a[tag=QAP] golden_apple
clear @a[tag=K] apple 1
tag @a remove QAP

tag @a[tag=K,nbt={Inventory:[{id:"minecraft:apple"}]}] add QAP
give @a[tag=QAP] golden_apple
clear @a[tag=K] apple 1
tag @a remove QAP

tag @a[tag=K,nbt={Inventory:[{id:"minecraft:apple"}]}] add QAP
give @a[tag=QAP] golden_apple
clear @a[tag=K] apple 1
tag @a remove QAP

tag @a[scores={KyuLuck=1..},tag=K,nbt={Inventory:[{id:"minecraft:apple"}]}] add QAP
give @a[scores={KyuLuck=1..},tag=QAP] golden_apple
clear @a[scores={KyuLuck=1..},tag=K] apple 1
tag @a remove QAP

tellraw @a[team=P] ["",{"text":"Your apples have been blessed!","color":"dark_red","italic":true}]
tellraw @a[team=P,scores={KyuLuck=1..}] ["",{"text":"Your luck causes an extra apple to be blessed!","color":"green","italic":true}]

execute as @a[tag=K,nbt={Inventory:[{id:"minecraft:apple"}]}] run execute if predicate suhc:25percent run execute if predicate suhc:25percent run execute if predicate suhc:25percent run tag @s add KyuNotchy
execute as @a[tag=!KyuNotchy,scores={KyuLuck=1..},tag=K,nbt={Inventory:[{id:"minecraft:apple"}]}] run execute if predicate suhc:25percent run execute if predicate suhc:25percent run execute if predicate suhc:25percent run execute if predicate suhc:50percent run tag @s add KyuNotchy2
tellraw @a[team=P,tag=KyuNotchy2] ["",{"text":"Your luck causes one of your apples to become REALLY blessed!","color":"gold","italic":true}]
tag @a[tag=KyuNotchy2] add KyuNotchy
give @a[tag=KyuNotchy] enchanted_golden_apple
clear @a[tag=KyuNotchy] apple 1
tellraw @a[team=P,tag=KyuNotchy,tag=!KyuNotchy2] ["",{"text":"One of your apples was REALLY blessed!","color":"gold","italic":true}]
tag @a remove KyuNotchy
tag @a remove KyuNotchy2

