scoreboard players add @s generic_timer 1

execute if score @s generic_timer matches 0..10 run function pctf:logic/items/lucky_block/anim/1
execute if score @s generic_timer matches 11..20 run function pctf:logic/items/lucky_block/anim/2
execute if score @s generic_timer matches 21..30 run function pctf:logic/items/lucky_block/anim/3
execute if score @s generic_timer matches 31..40 run function pctf:logic/items/lucky_block/anim/4
execute if score @s generic_timer matches 41.. run function pctf:logic/items/lucky_block/anim/5

execute if score @s generic_timer matches 40 run data merge entity @s[tag=!ultra_rare] {start_interpolation:0,interpolation_duration:20,transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0.0f,1.5f,0.0f],scale:[3f,3f,3f]}}
execute if score @s generic_timer matches 20 run data merge entity @s[tag=ultra_rare] {start_interpolation:0,interpolation_duration:40,transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0.0f,3.0f,0.0f],scale:[6f,6f,6f]}}

execute if score @s generic_timer matches 60 run function pctf:logic/items/lucky_block/open
execute if score @s generic_timer matches 60.. run kill @s