
# -> Attach new display
execute align xyz run \
    summon minecraft:item_display ~0.5 ~0.5 ~0.5 {Tags:["OverlyRealistic.TempEnt_HandleComponent_Adhesive","OverlyRealistic.Block.ToolHandle_Adhesive"], transformation: {left_rotation: [-0.7071068f, 0.0f, 0.0f, 0.7071068f], right_rotation: [0.0f, 0.0f, 0.0f, 1.0f], scale: [0.3125001f, 0.3125001f, 0.3125f], translation: [0.0f, -0.16f, -0.35f]}}
execute align xyz run \
    ride @n[type=item_display,tag=OverlyRealistic.TempEnt_HandleComponent_Adhesive,dx=0,dy=0,dz=0] mount @s
execute on passengers run \
    tag @s remove OverlyRealistic.TempEnt_HandleComponent_Adhesive

# -> Rotate new display
execute on passengers \
    if entity @s[tag=OverlyRealistic.Block.ToolHandle_Adhesive] \
    store result entity @s Rotation[0] float 1 \
    on vehicle run \
        data get entity @s data.display_rotation

# -> Set display item
execute on passengers \
    if entity @s[tag=OverlyRealistic.Block.ToolHandle_Adhesive] run \
        item replace entity @s contents from entity 00000001-0000-002b-0000-00010000002b contents
execute on passengers \
    if entity @s[tag=OverlyRealistic.Block.ToolHandle_Adhesive] run \
        item modify entity @s contents overly_realistic:multipurpose/set_to_one_item

# -> Set item place success
scoreboard players set #or.tool_handle_item_place_success OverlyRealistic.General.ArbitraryData 1

# -> Remove text
execute on passengers run \
    kill @s[tag=OverlyRealistic.Block.ToolHandle_Text]
execute on passengers run \
    kill @s[tag=OverlyRealistic.Block.ToolHandle_TextBackground]

# -> Increase progress
scoreboard players set @s OverlyRealistic.General.ArbitraryData 3

# -> Add to max_durability modifier & type value

# -> pine pitch glue (durability: +500, type: 1)
execute if items entity 00000001-0000-002b-0000-00010000002b contents *[custom_data~{or_adhesive_type:"pine_pitch_glue"}] run \
    return run \
        function overly_realistic:general/custom_blocks/tool_handle/interaction_events/progress_2/set_item/pine_pitch_glue

# -> resin clump (durability: +180, type: 2)
execute if items entity 00000001-0000-002b-0000-00010000002b contents resin_clump run \
    return run \
        function overly_realistic:general/custom_blocks/tool_handle/interaction_events/progress_2/set_item/resin_clump

# -> honey (durability: +35, type: 3)
execute if items entity 00000001-0000-002b-0000-00010000002b contents honey_bottle run \
    return run \
        function overly_realistic:general/custom_blocks/tool_handle/interaction_events/progress_2/set_item/honey_bottle

# -> bone glue (durability: +250, type: 4)
execute if items entity 00000001-0000-002b-0000-00010000002b contents *[custom_data~{or_adhesive_type:"bone_glue"}] run \
    return run \
        function overly_realistic:general/custom_blocks/tool_handle/interaction_events/progress_2/set_item/bone_glue

# -> fish glue (durability: +120, type: 5)
execute if items entity 00000001-0000-002b-0000-00010000002b contents *[custom_data~{or_adhesive_type:"fish_glue"}] run \
    return run \
        function overly_realistic:general/custom_blocks/tool_handle/interaction_events/progress_2/set_item/fish_glue

# - pine pitch glue (+500)
# - bone glue (+250)
# - resin clump (+180)
# - fish glue (+120)
# - honey (+35)
