
# -> Set break value
scoreboard players set #or.break_ship_attempt_value OverlyRealistic.General.ArbitraryData 0
scoreboard players operation #or.break_ship_attempt_value OverlyRealistic.General.ArbitraryData = @s OverlyRealistic.World.LargeShip_BreakValue

# -> Add to break value
scoreboard players add #or.break_ship_attempt_value OverlyRealistic.General.ArbitraryData 1

# -> If player is using an axe then increase value
execute if score #or.mast_attack_player_using_axe OverlyRealistic.General.ArbitraryData matches 1 run \
    scoreboard players add #or.break_ship_attempt_value OverlyRealistic.General.ArbitraryData 4

# -> If player is in creative then increase value
execute if score #or.mast_attack_player_in_creative OverlyRealistic.General.ArbitraryData matches 1 run \
    scoreboard players set #or.break_ship_attempt_value OverlyRealistic.General.ArbitraryData 100

# -> Clamp break value
execute if score #or.break_ship_attempt_value OverlyRealistic.General.ArbitraryData matches 101.. run \
    scoreboard players set #or.break_ship_attempt_value OverlyRealistic.General.ArbitraryData 100

# -> Store break value
scoreboard players operation @s OverlyRealistic.World.LargeShip_BreakValue = #or.break_ship_attempt_value OverlyRealistic.General.ArbitraryData

# -> If break value is over 100 then break
execute unless score @s OverlyRealistic.World.LargeShip_BreakValue matches 100.. run \
    return fail

# -> Break ship
function overly_realistic:general/custom_blocks/large_ship/large_ship_break
