execute store result score quest1.craft.flower_count temp run data get entity @s SelectedItem.count
execute as @e[tag=aj.quest1_crafting_table.root] run function animated_java:quest1_crafting_table/animations/craft/play
execute as @e[tag=quest1_crafting_table.hitbox] run tag @s add crafting
schedule function lbdm:quest1/crafting_table/craft_end 3.25s
data modify storage lbdm:main quest1.crafting_table.flower_type set from entity @s SelectedItem.components."minecraft:custom_data".flower
data modify storage lbdm:main quest1.crafting_table.flower_count set from entity @s SelectedItem.count

execute if data storage lbdm:main {quest1:{crafting_table:{flower_type:"g"}}} as @e[tag=aj.quest1_crafting_table.root] run function animated_java:quest1_crafting_table/variants/default/apply
execute if data storage lbdm:main {quest1:{crafting_table:{flower_type:"p"}}} as @e[tag=aj.quest1_crafting_table.root] run function animated_java:quest1_crafting_table/variants/flower_p/apply
execute if data storage lbdm:main {quest1:{crafting_table:{flower_type:"s"}}} as @e[tag=aj.quest1_crafting_table.root] run function animated_java:quest1_crafting_table/variants/flower_s/apply

execute if data storage lbdm:main {quest1:{crafting_table:{flower_type:"g"}}} run data merge storage lbdm:main {quest1:{crafting_table:{dye_name:"Загадка Пернатого Странника"}}}
execute if data storage lbdm:main {quest1:{crafting_table:{flower_type:"p"}}} run data merge storage lbdm:main {quest1:{crafting_table:{dye_name:"Секрет Безумного Торжества"}}}
execute if data storage lbdm:main {quest1:{crafting_table:{flower_type:"s"}}} run data merge storage lbdm:main {quest1:{crafting_table:{dye_name:"Фестивальный Фиксплюс"}}}

item replace entity @s weapon.mainhand with air

execute at @e[tag=quest1_crafting_table.hitbox] run playsound block.portal.trigger master @a ~ ~ ~