execute as @e[type=interaction,tag=reset] on attacker at @s run function main:hub/objects/workshop/reset

# #on
# execute as @e[type=interaction,tag=upgrade] on attacker as @s[tag=!workshop_upgrade] at @s run return run function main:hub/objects/workshop/upgrade_1
# execute as @e[type=interaction,tag=level] on attacker as @s[tag=!workshop_level] at @s run return run function main:hub/objects/workshop/level_1

# #off
# execute as @e[type=interaction,tag=upgrade] on attacker as @s[tag=workshop_upgrade] at @s run return run function main:hub/objects/workshop/upgrade_2
# execute as @e[type=interaction,tag=level] on attacker as @s[tag=workshop_level] at @s run return run function main:hub/objects/workshop/level_2

# execute as @e[type=interaction,tag=relics] on attacker as @s at @s run function main:hub/objects/workshop/craft/start

execute as @a if items entity @s weapon.mainhand written_book[custom_data={book:crafting_hub}] run function main:hub/objects/workshop/craft/replace
execute as @s unless items entity @a weapon.mainhand written_book[custom_data={book:crafting_hub}] run kill @e[type=item_display,tag=workshop_circle]
execute if items entity @a weapon.mainhand written_book[custom_data={book:crafting_hub}] as @e[type=marker,tag=workshop_spot] at @s run function main:hub/objects/workshop/craft/holding

execute as @e[type=marker,tag=workshop_spot] at @s if score .workshop_craft hub matches 1.. run function main:hub/objects/workshop/craft/particle
execute if score .workshop_craft hub matches 1.. run scoreboard players remove .workshop_craft hub 1