
# -> Check for iron tools
#execute if items entity @s contents #overly_realistic:iron_tools \
    unless items entity @s contents *[custom_data~{current_process:"forged"}] run \
        return run \
            function overly_realistic:general/forgery/iron_tools/iron_tool_drop_detect with entity @s Item.components."minecraft:custom_data"

# -> If the item is a specialized drop then run return and operate accordingly
execute if items entity @s contents *[custom_data~{or_is_specialized_drop:1b}] run \
    return run \
        function overly_realistic:general/items/item_drops/specialized_item_drops/get_specialized_drop

# -> If item does not have or_edited_item=true data then edit it
execute unless items entity @s contents *[custom_data~{or_edited_item:1b}] run \
    function overly_realistic:general/items/edit_item_general_from_ent

# -> Tag item
tag @s add OverlyRealistic.CheckedItemDrop

# -> Debug
#particle flame ~ ~ ~ 0 0 0 0.0001 100 force @a

# -> If block above is collapseable, then try to collapse it
execute if score #or.setting.block_gravity OverlyRealistic.Settings.ArbitrarySetting matches 1 \
    if block ~ ~ ~ #overly_realistic:can_collapse_from \
    unless block ~ ~1 ~ #overly_realistic:cant_collapse \
    unless predicate overly_realistic:world/block_physics/block_supported_by_cant_collapse_blocks \
    positioned ~ ~1 ~ \
    summon marker run \
        function overly_realistic:general/block_physics/create_collapse_marker
