execute rotated as @s run function items:shop/display_place

execute as @e[tag=shop_d,sort=nearest,limit=1] run function olink:ch1/find_linked
execute if entity @s[tag=wand] as @e[tag=selector,tag=ch1_olinked,limit=1] at @s run function items_py:shop/display/wand
execute if entity @s[tag=weapon] as @e[tag=selector,tag=ch1_olinked,limit=1] at @s run function items_py:shop/display/weapon
execute if entity @s[tag=armor] as @e[tag=selector,tag=ch1_olinked,limit=1] at @s run function items_py:shop/display/armor
execute if entity @s[tag=passive] as @e[tag=selector,tag=ch1_olinked,limit=1] at @s run function items_py:shop/display/passive
execute if entity @s[tag=shard] as @e[tag=selector,tag=ch1_olinked,limit=1] at @s run function items_py:shop/display/shard
execute if entity @s[tag=food] as @e[tag=selector,tag=ch1_olinked,limit=1] at @s run function items:shop/display/food
execute if entity @s[tag=potion] as @e[tag=selector,tag=ch1_olinked,limit=1] at @s run function items:shop/display/potion
execute if entity @s[tag=meta_coin] if score active shop matches 0 run kill @e[tag=shop_d,tag=ch1_olinked,limit=4]
execute if entity @s[tag=meta_coin] if score active shop matches 1 as @e[tag=selector,tag=ch1_olinked,limit=1] at @s run function items:shop/display/meta_coin

execute as @e[tag=selector,tag=!food,tag=!potion,tag=!meta_coin,tag=ch1_olinked,limit=1] at @s run function generate:2_populate/shop/price

kill @s

tag @e[type=item,tag=shop_d] add mapping
