
# -> Progress 0 : adding stripped log (part 1)

# -> If player does not have the right materials then return
execute unless items entity 00000001-0000-002b-0000-00010000002b contents #overly_realistic:stripped_logs run \
    return fail

# -> Add to progress
scoreboard players add @s OverlyRealistic.General.ArbitraryData 1

# -> Set success
scoreboard players set #or.item_success OverlyRealistic.General.ArbitraryData 1

# -> Sound
playsound block.wood.place block @a ~ ~ ~ 0.6 1

# -> Update text
execute on passengers \
    if entity @s[type=text_display,tag=OverlyRealistic.Block.CraftingTableSetup_Text] run \
        data modify entity @s text set value [{"sprite":"minecraft:block/crafting_table_front","extra":["\n",{"sprite":"minecraft:block/oak_planks"}," 0/10"]}]

# -> Update model
summon minecraft:item_display ~ ~ ~ {Tags:["OverlyRealistic.Block.CraftingTableSetup_Part_1","OverlyRealistic.TempEntSetup"],item: {count: 1, id: "minecraft:stripped_oak_log"}, transformation: {left_rotation: [0.0f, 0.0f, 0.0f, 1.0f], right_rotation: [0.0f, 0.0f, 0.0f, 1.0f], scale: [0.87500006f, 0.93750006f, 0.87500006f], translation: [0.0f, 0.5142857f, 0.0f]}}
ride @n[type=item_display,tag=OverlyRealistic.TempEntSetup,distance=..1] mount @s
execute on passengers run \
    item replace entity @s[tag=OverlyRealistic.TempEntSetup] contents from entity 00000001-0000-002b-0000-00010000002b contents
execute on passengers run \
    tag @s remove OverlyRealistic.TempEntSetup
