
# -> Sound
playsound item.armor.equip_leather block @a ~ ~ ~ 0.5 2
playsound minecraft:block.honey_block.slide block @a ~ ~ ~ 0.5 2

# -> Particle
particle block{block_state:"redstone_block"} ~ ~ ~ 0.2 0.2 0.2 0.001 1 normal @a

# -> Add to progress
scoreboard players add @s OverlyRealistic.World.WoodenRackScrapeGoryHideProgress 2

# -> Cap progress
scoreboard players set @s[scores={OverlyRealistic.World.WoodenRackScrapeGoryHideProgress=101..}] OverlyRealistic.World.WoodenRackScrapeGoryHideProgress 100

# -> Globalize progress
scoreboard players operation #or.scrape_gory_hide_progress OverlyRealistic.General.ArbitraryData = @s OverlyRealistic.World.WoodenRackScrapeGoryHideProgress

# -> Display progress to player
execute on target run \
    function overly_realistic:general/custom_blocks/wooden_rack/interactions/gory_hide/scrape_gory_hide_progress_display

# -> If max value has not been reached, then return
execute unless score @s OverlyRealistic.World.WoodenRackScrapeGoryHideProgress matches 100.. run \
    return fail

# -> Reset progress
scoreboard players reset @s OverlyRealistic.World.WoodenRackScrapeGoryHideProgress

# -> Modify hide item
execute on passengers \
    if entity @s[tag=OverlyRealistic.Block.WoodenRack_Item] run \
        function overly_realistic:general/custom_blocks/wooden_rack/interactions/gory_hide/scrape_gory_hide_item_modify with entity @s item.components."minecraft:custom_data"

# -> Set tags
tag @s remove OverlyRealistic.Block.WoodenRack_Status_Filled_Item_GoryHide
tag @s add OverlyRealistic.Block.WoodenRack_Status_Filled_Item_Hide
