scoreboard players reset @s timer
tag @s remove placedbet
tag @s remove special
execute unless score @s burst matches 2.. run particle poof ~ ~.2 ~ 0 0 0 0 5
playsound minecraft:block.note_block.chime block @a ~ ~ ~ 1 2

execute if score @s dropmoss matches 1.. store result score @s itemcount run scoreboard players operation @s itemcount /= @s dropmoss
execute if score @s days matches 1.. store result score @s itemcount run scoreboard players operation @s itemcount *= @s days
execute if score @s itemcount matches ..0 run particle smoke ~ ~ ~ 0 0 0 0 5
execute if score @s itemcount matches ..0 run kill @s

execute if score @s burst matches 2.. run data merge entity @s {Item:{id:"minecraft:chiseled_nether_bricks",components:{"minecraft:item_name":{"text":"Green Key","italic":false,"color":"green"},"minecraft:can_place_on":{predicates:[{blocks:"green_terracotta"}]}}}}
execute if score @s burst matches 2.. run particle smoke ~ ~ ~ 0 0 0 0 5
execute if score @s burst matches 2.. run scoreboard players set @s itemcount 1

execute if score @s itemcount matches 65.. at @s run function survivalplus:finale/slots/overflow
execute store result entity @s Item.Count double 1 run scoreboard players get @s itemcount
scoreboard players reset @s burst
scoreboard players reset @s days
scoreboard players reset @s dropmoss
scoreboard players reset @s itemcount