advancement revoke @s only lbdm:click/quest3/end_door

execute unless items entity @s weapon.mainhand firework_star run return fail
execute unless items entity @s weapon.mainhand firework_star[custom_data={quest3_true_key:1}] run function lbdm:main/dialogue/display/phrase {name:"Lololowka","color":"#0098bd","text":"Чёрт, этот ключ не подходит."}
execute unless items entity @s weapon.mainhand firework_star[custom_data={quest3_true_key:1}] run playsound minecraft:item.shield.break master @a ~ ~ ~
execute unless items entity @s weapon.mainhand firework_star[custom_data={quest3_true_key:1}] run return run item replace entity @s weapon.mainhand with air

execute as @e[tag=quest3_end_door] run function animated_java:quest2_door/animations/open2/play
schedule function lbdm:quest3/end_door/open_end 0.5s
kill @e[tag=quest3_end_door.hitbox]
function lbdm:main/quest_ui/remove
clear @a
kill @e[type=item]

execute as @e[tag=quest3_elevator] run function animated_java:elevator_door/animations/open/play
execute as @e[tag=quest4_elevator] run function animated_java:elevator_door/animations/close/play

fill 241 -47 -27 241 -49 -26 barrier
fill 241 -58 -27 241 -60 -26 air
playsound block.wooden_door.open master @a 241 -58 -27 1 0.7