
# -> Filter block
scoreboard players set #or.large_ship_block_break_filter OverlyRealistic.General.ArbitraryData 0
execute on attacker \
    if entity @s[tag=OverlyRealistic.Player.BrokeCustomBlock] run \
        scoreboard players set #or.large_ship_block_break_filter OverlyRealistic.General.ArbitraryData 1
execute unless score #or.large_ship_block_break_filter OverlyRealistic.General.ArbitraryData matches 1 run \
    return fail

# -> If part is not the mast then return and remove attacker data
execute if entity @s[tag=!OverlyRealistic.Block.Ship_Part_IsMast] run \
    return run \
        data remove entity @s attack

# -> Operate on player
execute on attacker run \
    function overly_realistic:general/custom_blocks/large_ship/break_attempt/player_init_operations

# -> Break function
execute on vehicle \
    on vehicle \
    on vehicle \
    on vehicle run \
        function overly_realistic:general/custom_blocks/large_ship/large_ship_break_attempt

# -> Display value to player
execute on attacker run \
    function overly_realistic:general/custom_blocks/large_ship/break_attempt/player_display_break

# -> Remove attack data
data remove entity @s attack
