setblock ~ ~ ~ barrier
function animated_java:quest1_shelf/summon {args:{}}
summon interaction ~ ~ ~ {height:1.02f,width:1.02f,Tags:["quest1_shelf.hitbox"],response:true}
tag @n[tag=quest1_shelf.spawnpoint] add quest1_shelf.spawnpoint.spawned
data modify entity @n[tag=quest1_shelf.hitbox] Rotation set from entity @n[tag=quest1_shelf.spawnpoint] Rotation

scoreboard players reset quest1.shelfs_count.3 temp
execute as @e[tag=quest1_shelf.hitbox,tag=loot.flower3] run scoreboard players add quest1.shelfs_count.3 temp 1
execute unless score quest1.shelfs_count.3 temp matches 1.. run return run tag @n[tag=quest1_shelf.hitbox] add loot.flower3

scoreboard players reset quest1.shelfs_count.1 temp
execute as @e[tag=quest1_shelf.hitbox,tag=loot.flower1] run scoreboard players add quest1.shelfs_count.1 temp 1
execute unless score quest1.shelfs_count.1 temp matches 2.. run return run tag @n[tag=quest1_shelf.hitbox] add loot.flower1

scoreboard players reset quest1.shelfs_count.j temp
execute as @e[tag=quest1_shelf.hitbox,tag=loot.jumpscare] run scoreboard players add quest1.shelfs_count.j temp 1
execute unless score quest1.shelfs_count.j temp matches 2.. run return run tag @n[tag=quest1_shelf.hitbox] add loot.jumpscare