advancement revoke @s only minecraft:suhc/placesoullantern
advancement grant @s only minecraft:suhc/placesoullantern2
execute as @s[tag=!PlacedSoulLantern] run tellraw @a[tag=K] ["",{"selector":"@s","color":"white"},{"text":" has made the advancement ","color":"white"},{"text":"[","color":"#9B07DB"},{"text":"Skill Issue","color":"#C505FF","hoverEvent":{"action":"show_text","value":{"text":"","extra":[{"text":"Skill Issue\n","color":"#C505FF"},{"text":"You placed down your Soul Lantern...Really?","color":"#3EC4E6"}]}}},{"text":"]","color":"#9B07DB"},{"text":"."}]
tag @s add PlacedSoulLantern

summon item ~ ~ ~ {Tags:["ApplyTrinkets"],PickupDelay:2,Item:{id:"minecraft:soul_lantern",Count:1b,tag:{kyuonetickmainhand:1b,kyuonetickoffhand:1b,kyutrinket:1b,trinketholder:1b,HideFlags:1,Enchantments:[{id:"minecraft:protection",lvl:1s}],display:{Name:"{\"text\":\"Cadeyrn's Soul Lantern\",\"color\":\"#9B07DB\"}",Lore:["{\"text\":\"Can be combined with trinkets to gain their effects. Current trinkets:\",\"color\":\"#3EC4E6\"}"]}}}}

tellraw @s ["",{"text":"As you place your Soul Lantern, it returns itself to your inventory.","color":"dark_aqua","italic":true}]

execute at @s[scores={KyuSoulLantern=1024..}] run execute as @e[type=item,limit=1,sort=nearest,tag=ApplyTrinkets] run data modify entity @s Item.tag.display.Lore append value '{"text":"Night Vision Goggles ","color":"#17FFB2"}'
execute at @s[scores={KyuSoulLantern=1024..}] run execute as @e[type=item,limit=1,sort=nearest,tag=ApplyTrinkets] run data modify entity @s Item.tag merge value {kyugoggles:1b}
execute as @s[scores={KyuSoulLantern=1024..}] run scoreboard players remove @s KyuSoulLantern 1024

execute at @s[scores={KyuSoulLantern=512..}] run execute as @e[type=item,limit=1,sort=nearest,tag=ApplyTrinkets] run data modify entity @s Item.tag.display.Lore append value '{"text":"Dawn\'s Daylight ","color":"#E0A212"}'
execute at @s[scores={KyuSoulLantern=512..}] run execute as @e[type=item,limit=1,sort=nearest,tag=ApplyTrinkets] run data modify entity @s Item.tag merge value {kyudayextender:1b}
execute as @s[scores={KyuSoulLantern=512..}] run scoreboard players remove @s KyuSoulLantern 512

execute at @s[scores={KyuSoulLantern=256..}] run execute as @e[type=item,limit=1,sort=nearest,tag=ApplyTrinkets] run data modify entity @s Item.tag.display.Lore append value '{"text":"Pure Unrefined Knowledge ","color":"#8B59FF"}'
execute at @s[scores={KyuSoulLantern=256..}] run execute as @e[type=item,limit=1,sort=nearest,tag=ApplyTrinkets] run data modify entity @s Item.tag merge value {kyuxptrinket:1b}
execute as @s[scores={KyuSoulLantern=256..}] run scoreboard players remove @s KyuSoulLantern 256

execute at @s[scores={KyuSoulLantern=128..}] run execute as @e[type=item,limit=1,sort=nearest,tag=ApplyTrinkets] run data modify entity @s Item.tag.display.Lore append value '{"text":"Nature\'s Gift ","color":"#3EFF29"}'
execute at @s[scores={KyuSoulLantern=128..}] run execute as @e[type=item,limit=1,sort=nearest,tag=ApplyTrinkets] run data modify entity @s Item.tag merge value {kyunaturegift:1b}
execute as @s[scores={KyuSoulLantern=128..}] run scoreboard players remove @s KyuSoulLantern 128

execute at @s[scores={KyuSoulLantern=64..}] run execute as @e[type=item,limit=1,sort=nearest,tag=ApplyTrinkets] run data modify entity @s Item.tag.display.Lore append value '{"text":"Suspicious Spices ","color":"#FF4E33"}'
execute at @s[scores={KyuSoulLantern=64..}] run execute as @e[type=item,limit=1,sort=nearest,tag=ApplyTrinkets] run data modify entity @s Item.tag merge value {kyuspices:1b}
execute as @s[scores={KyuSoulLantern=64..}] run scoreboard players remove @s KyuSoulLantern 64

execute at @s[scores={KyuSoulLantern=32..}] run execute as @e[type=item,limit=1,sort=nearest,tag=ApplyTrinkets] run data modify entity @s Item.tag.display.Lore append value '{"text":"Slowfall(when in mainhand) ","color":"#E0AFE0"}'
execute at @s[scores={KyuSoulLantern=32..}] run execute as @e[type=item,limit=1,sort=nearest,tag=ApplyTrinkets] run data modify entity @s Item.tag merge value {kyuslowfall:1b}
execute as @s[scores={KyuSoulLantern=32..}] run scoreboard players remove @s KyuSoulLantern 32

execute at @s[scores={KyuSoulLantern=16..}] run execute as @e[type=item,limit=1,sort=nearest,tag=ApplyTrinkets] run data modify entity @s Item.tag.display.Lore append value '{"text":"Lucky Dubloon ","color":"#FFEE00"}'
execute at @s[scores={KyuSoulLantern=16..}] run execute as @e[type=item,limit=1,sort=nearest,tag=ApplyTrinkets] run data modify entity @s Item.tag merge value {kyudubloon:1b}
execute as @s[scores={KyuSoulLantern=16..}] run scoreboard players remove @s KyuSoulLantern 16

execute at @s[scores={KyuSoulLantern=8..}] run execute as @e[type=item,limit=1,sort=nearest,tag=ApplyTrinkets] run data modify entity @s Item.tag.display.Lore append value '{"text":"Enchanted Shard ","color":"#08B5FF"}'
execute at @s[scores={KyuSoulLantern=8..}] run execute as @e[type=item,limit=1,sort=nearest,tag=ApplyTrinkets] run data modify entity @s Item.tag merge value {kyuenchantedshard:1b}
execute as @s[scores={KyuSoulLantern=8..}] run scoreboard players remove @s KyuSoulLantern 8

execute at @s[scores={KyuSoulLantern=4..}] run execute as @e[type=item,limit=1,sort=nearest,tag=ApplyTrinkets] run data modify entity @s Item.tag.display.Lore append value '{"text":"Eye of the Void ","color":"#7300B5"}'
execute at @s[scores={KyuSoulLantern=4..}] run execute as @e[type=item,limit=1,sort=nearest,tag=ApplyTrinkets] run data modify entity @s Item.tag merge value {kyuvoidtrinket:1b}
execute as @s[scores={KyuSoulLantern=4..}] run scoreboard players remove @s KyuSoulLantern 4


scoreboard players set @s KyuSoulLantern 0


execute at @s run execute positioned ^ ^ ^1 run fill ~-3 ~-3 ~-3 ~3 ~3 ~3 air replace soul_lantern