execute if entity @s[tag=shard] run scoreboard players set min rng 5
execute if entity @s[tag=shard] run scoreboard players set max rng 15
execute if entity @s[tag=passive] run scoreboard players set min rng 20
execute if entity @s[tag=passive] run scoreboard players set max rng 35
execute if entity @s[tag=wand] run scoreboard players set min rng 22
execute if entity @s[tag=wand] run scoreboard players set max rng 40
execute if entity @s[tag=armor] run scoreboard players set min rng 25
execute if entity @s[tag=armor] run scoreboard players set max rng 45
execute if entity @s[tag=weapon] run scoreboard players set min rng 30
execute if entity @s[tag=weapon] run scoreboard players set max rng 50

function rng:interval
scoreboard players operation @s shop = out rng


scoreboard players add @s[tag=c] shop 8
scoreboard players add @s[tag=b] shop 16
scoreboard players add @s[tag=a] shop 24
scoreboard players add @s[tag=s] shop 32


setblock ~ 1 ~ oak_sign{Text1:'[{"score":{"name":"@e[tag=selector,tag=ch1_olinked,limit=1]","objective":"shop"},"color":"#ED7F3B"},{"text":"\\uF81e","color":"white"}]'} replace
data modify entity @e[tag=cost,tag=ch1_olinked,limit=1] CustomName set from block ~ 1 ~ Text1
setblock ~ 1 ~ air replace
