scoreboard players operation $temp StorageCount = @s StorageCount
tag @s add StorageHolding
execute as @e[tag=custom_storage] at @s if score @s StorageCount = $temp StorageCount run tp @s @p[tag=StorageHolding,nbt={SelectedItem:{id:"minecraft:structure_block",components:{"minecraft:custom_data":{storage:1b}}}},limit=1,sort=nearest]
execute as @e[tag=custom_storage] at @s if score @s StorageCount = $temp StorageCount run tp @s ^ ^1 ^1.5 facing entity @p
tag @s remove StorageHolding