
# -> Get if scribing table has a paper
scoreboard players set #or.scribing_table_has_paper OverlyRealistic.General.ArbitraryData 0
execute if entity @s[tag=OverlyRealistic.Block.ScribingTable_HasPaper] run \
    scoreboard players set #or.scribing_table_has_paper OverlyRealistic.General.ArbitraryData 1

# -> Reset interaction ID
scoreboard players set #or.scribing_table_interaction_id OverlyRealistic.General.ArbitraryData 0

# -> Operate on player
execute on target run \
    function overly_realistic:general/custom_blocks/scribing_table/player_interact_with_scribing_table

# --> Interactions

# -> Remove items
execute if score #or.scribing_table_interaction_id OverlyRealistic.General.ArbitraryData matches 1 run \
    return run \
        function overly_realistic:general/custom_blocks/scribing_table/interactions/int_remove_items

# -> Input paper
execute if score #or.scribing_table_interaction_id OverlyRealistic.General.ArbitraryData matches 2 run \
    return run \
        function overly_realistic:general/custom_blocks/scribing_table/interactions/int_put_paper

# -> Write on paper
execute if score #or.scribing_table_interaction_id OverlyRealistic.General.ArbitraryData matches 3 run \
    return run \
        function overly_realistic:general/custom_blocks/scribing_table/interactions/int_write

# -> Complete
execute if score #or.scribing_table_interaction_id OverlyRealistic.General.ArbitraryData matches 4 run \
    return run \
        function overly_realistic:general/custom_blocks/scribing_table/interactions/int_complete

# -> Input paper draft
execute if score #or.scribing_table_interaction_id OverlyRealistic.General.ArbitraryData matches 5 run \
    return run \
        function overly_realistic:general/custom_blocks/scribing_table/interactions/int_put_paper_draft
